### Question:
GradleProjectProperties implements ProjectProperties { String getWarFilePath() { TaskProvider<Task> bootWarTask = TaskCommon.getBootWarTaskProvider(project); if (bootWarTask != null && bootWarTask.get().getEnabled()) { return bootWarTask.get().getOutputs().getFiles().getAsPath(); } TaskProvider<Task> warTask = TaskCommon.getWarTaskProvider(project); return Verify.verifyNotNull(warTask).get().getOutputs().getFiles().getAsPath(); } @VisibleForTesting  GradleProjectProperties(
      Project project,
      Logger logger,
      TempDirectoryProvider tempDirectoryProvider,
      Supplier<List<JibGradlePluginExtension<?>>> extensionLoader); static GradleProjectProperties getForProject(
      Project project, Logger logger, TempDirectoryProvider tempDirectoryProvider); @Override JibContainerBuilder createJibContainerBuilder(
      JavaContainerBuilder javaContainerBuilder, ContainerizingMode containerizingMode); @Override List<Path> getClassFiles(); @Override void waitForLoggingThread(); @Override void configureEventHandlers(Containerizer containerizer); @Override void log(LogEvent logEvent); @Override String getToolName(); @Override String getToolVersion(); @Override String getPluginName(); @Nullable @Override String getMainClassFromJarPlugin(); @Override Path getDefaultCacheDirectory(); @Override String getJarPluginName(); @Override boolean isWarProject(); @Override String getName(); @Override String getVersion(); @Override int getMajorJavaVersion(); @Override boolean isOffline(); @Override JibContainerBuilder runPluginExtensions(
      List<? extends ExtensionConfiguration> extensionConfigs,
      JibContainerBuilder jibContainerBuilder);  }### Answer:
@Test public void testGetWarFilePath() { Mockito.when(mockProject.getPlugins().hasPlugin(WarPlugin.class)).thenReturn(true); Mockito.when(mockTaskContainer.named("war")).thenReturn(mockWarTaskProvider); Mockito.when(mockWarTaskProvider.get().getOutputs().getFiles().getAsPath()) .thenReturn("/war/file/here.war"); Assert.assertEquals("/war/file/here.war", gradleProjectProperties.getWarFilePath()); }
@Test public void testGetWarFilePath_bootWar() { Mockito.when(mockProject.getPlugins().hasPlugin("org.springframework.boot")).thenReturn(true); Mockito.when(mockTaskContainer.named("bootWar")).thenReturn(mockBootWarTaskProvider); Mockito.when(mockBootWarTaskProvider.get().getEnabled()).thenReturn(true); Mockito.when(mockBootWarTaskProvider.get().getOutputs().getFiles().getAsPath()) .thenReturn("/boot/war/file.war"); Assert.assertEquals("/boot/war/file.war", gradleProjectProperties.getWarFilePath()); }
@Test public void testGetWarFilePath_bootWarDisabled() { Mockito.when(mockProject.getPlugins().hasPlugin("org.springframework.boot")).thenReturn(true); Mockito.when(mockTaskContainer.named("bootWar")).thenReturn(mockBootWarTaskProvider); Mockito.when(mockBootWarTaskProvider.get().getOutputs().getFiles().getAsPath()) .thenReturn("boot.war"); Mockito.when(mockProject.getPlugins().hasPlugin(WarPlugin.class)).thenReturn(true); Mockito.when(mockTaskContainer.named("war")).thenReturn(mockWarTaskProvider); Mockito.when(mockWarTaskProvider.get().getOutputs().getFiles().getAsPath()) .thenReturn("war.war"); Assert.assertEquals("war.war", gradleProjectProperties.getWarFilePath()); }