### Question:
PluginConfigurationProcessor { @VisibleForTesting static AbsoluteUnixPath getAppRootChecked( RawConfiguration rawConfiguration, ProjectProperties projectProperties) throws InvalidAppRootException { String appRoot = rawConfiguration.getAppRoot(); if (appRoot.isEmpty()) { appRoot = projectProperties.isWarProject() ? JavaContainerBuilder.DEFAULT_WEB_APP_ROOT : JavaContainerBuilder.DEFAULT_APP_ROOT; } try { return AbsoluteUnixPath.get(appRoot); } catch (IllegalArgumentException ex) { throw new InvalidAppRootException(appRoot, appRoot, ex); } }  static JibBuildRunner createJibBuildRunnerForDockerDaemonImage(
      RawConfiguration rawConfiguration,
      InferredAuthProvider inferredAuthProvider,
      ProjectProperties projectProperties,
      HelpfulSuggestions helpfulSuggestions); static JibBuildRunner createJibBuildRunnerForTarImage(
      RawConfiguration rawConfiguration,
      InferredAuthProvider inferredAuthProvider,
      ProjectProperties projectProperties,
      HelpfulSuggestions helpfulSuggestions); static JibBuildRunner createJibBuildRunnerForRegistryImage(
      RawConfiguration rawConfiguration,
      InferredAuthProvider inferredAuthProvider,
      ProjectProperties projectProperties,
      HelpfulSuggestions helpfulSuggestions); static String getSkaffoldSyncMap(
      RawConfiguration rawConfiguration, ProjectProperties projectProperties, Set<Path> excludes);  }### Answer:
@Test public void testGetAppRootChecked() throws InvalidAppRootException { Mockito.when(rawConfiguration.getAppRoot()).thenReturn("/some/root"); Assert.assertEquals( AbsoluteUnixPath.get("/some/root"), PluginConfigurationProcessor.getAppRootChecked(rawConfiguration, projectProperties)); }
@Test public void testGetAppRootChecked_errorOnNonAbsolutePath() { Mockito.when(rawConfiguration.getAppRoot()).thenReturn("relative/path"); try { PluginConfigurationProcessor.getAppRootChecked(rawConfiguration, projectProperties); Assert.fail(); } catch (InvalidAppRootException ex) { Assert.assertEquals("relative/path", ex.getMessage()); } }
@Test public void testGetAppRootChecked_errorOnWindowsPath() { Mockito.when(rawConfiguration.getAppRoot()).thenReturn("\\windows\\path"); try { PluginConfigurationProcessor.getAppRootChecked(rawConfiguration, projectProperties); Assert.fail(); } catch (InvalidAppRootException ex) { Assert.assertEquals("\\windows\\path", ex.getMessage()); } }
@Test public void testGetAppRootChecked_errorOnWindowsPathWithDriveLetter() { Mockito.when(rawConfiguration.getAppRoot()).thenReturn("C:\\windows\\path"); try { PluginConfigurationProcessor.getAppRootChecked(rawConfiguration, projectProperties); Assert.fail(); } catch (InvalidAppRootException ex) { Assert.assertEquals("C:\\windows\\path", ex.getMessage()); } }
@Test public void testGetAppRootChecked_defaultNonWarProject() throws InvalidAppRootException { Mockito.when(rawConfiguration.getAppRoot()).thenReturn(""); Mockito.when(projectProperties.isWarProject()).thenReturn(false); Assert.assertEquals( AbsoluteUnixPath.get("/app"), PluginConfigurationProcessor.getAppRootChecked(rawConfiguration, projectProperties)); }
@Test public void testGetAppRootChecked_defaultWarProject() throws InvalidAppRootException { Mockito.when(rawConfiguration.getAppRoot()).thenReturn(""); Mockito.when(projectProperties.isWarProject()).thenReturn(true); Assert.assertEquals( AbsoluteUnixPath.get("/jetty/webapps/ROOT"), PluginConfigurationProcessor.getAppRootChecked(rawConfiguration, projectProperties)); }