### Question:
WebHookTeamCityRestApiZipPluginFixer { protected File findTeamCityBaseLocation() { File teamCityHome = new File(this.mySBuildServer.getServerRootPath() + "/WEB-INF"); if (teamCityHome.exists() && teamCityHome.isDirectory()) { Loggers.SERVER.debug("WebHookTeamCityRestApiZipPluginFixer :: TeamCity WEB-INF is: " + teamCityHome.getAbsolutePath()); return teamCityHome; } Map<String, String> env = System.getenv(); File catalinaHome = getCatalinaHomeDir(env); if (catalinaHome != null) { Loggers.SERVER.debug("WebHookTeamCityRestApiZipPluginFixer :: CATALINA_HOME is: " + catalinaHome.getAbsolutePath()); return catalinaHome; } else { for (Entry<String,String> e : env.entrySet()) { Loggers.SERVER.debug("WebHookTeamCityRestApiZipPluginFixer :: " + e.getKey() + " : " + e.getValue()); } } Loggers.SERVER.debug("WebHookTeamCityRestApiZipPluginFixer :: CATALINA_HOME could not be determined. Next attempt: log4j.configuration property path"); String logLocation = System.getProperty("log4j.configuration"); if (logLocation != null) { File tcHomeDir = getTeamCityHomeDir(logLocation.replaceFirst("file\\:", "").replace("../conf/teamcity-server-log4j.xml", "../")); if (tcHomeDir != null) { Loggers.SERVER.debug("WebHookTeamCityRestApiZipPluginFixer :: TeamCity appears to be in: " + tcHomeDir.getAbsolutePath()); return tcHomeDir; } } return null; } WebHookTeamCityRestApiZipPluginFixer(SBuildServer sBuildServer); List<Path> getFoundApiZipFilesContainingJaxbJars(); boolean foundApiZipFilesContainingJaxbJars(); synchronized void findRestApiZipPlugins(); synchronized JarReport fixRestApiZipPlugin(Path p); static final String UNPACKED_LOCATION; }### Answer:
@Test public void testFindTeamCityBaseLocation() { when(sBuildServer.getServerRootPath()).thenReturn("src/test/resources/empty_teamcity_home/webapps/ROOT"); WebHookTeamCityRestApiZipPluginFixer fixer = new WebHookTeamCityRestApiZipPluginFixer(sBuildServer); fixer.findTeamCityBaseLocation(); }