### Question:
SakuliFolderHelper { public static String checkSahiProxyHomeAndSetContextVariables(String sahiProxyHomePath, String tempLogCache) throws FileNotFoundException { Path sahiFolder = normalizePath(sahiProxyHomePath); if (sahiFolder == null || !Files.exists(sahiFolder)) { throw new FileNotFoundException("sahi folder \"" + sahiProxyHomePath + "\" does not exist!"); } SakuliPropertyPlaceholderConfigurer.SAHI_HOME_VALUE = sahiFolder.toString(); return tempLogCache + "\nset property '" + SahiProxyProperties.PROXY_HOME_FOLDER + "' to \"" + SakuliPropertyPlaceholderConfigurer.SAHI_HOME_VALUE + "\""; }  static String checkTestSuiteFolderAndSetContextVariables(String testSuiteFolderPath, String tempLogCache); static Path normalizePath(String path); static String checkSakuliHomeFolderAndSetContextVariables(String sakuliMainFolderPath, String tempLogCache); static String checkSahiProxyHomeAndSetContextVariables(String sahiProxyHomePath, String tempLogCache); static String setTestSuiteBrowserContextVariable(String testSuiteBrowserName, String tempLogCache);  }### Answer:
@Test public void testCheckSahiProxyHomeAndSetContextVariables() throws Exception { final String absoluteSahiPath = Paths.get(TEST_FOLDER_PATH).toAbsolutePath().toString(); String log = ""; log = SakuliFolderHelper.checkSahiProxyHomeAndSetContextVariables(TEST_FOLDER_PATH, log); assertEquals(SakuliPropertyPlaceholderConfigurer.SAHI_HOME_VALUE, absoluteSahiPath); assertEquals(log, "\nset property '" + SahiProxyProperties.PROXY_HOME_FOLDER + "' to \"" + absoluteSahiPath + "\""); }
@Test(expectedExceptions = FileNotFoundException.class, expectedExceptionsMessageRegExp = "sahi folder .* does not exist!") public void testCheckSahiProxyHomeAndSetContextVariablesFolderMissing() throws Exception { SakuliFolderHelper.checkSahiProxyHomeAndSetContextVariables("not-valid-path/to-sahi-home", ""); }