@Before
  public void setUp() {
    Mockito.when(mockLogger.isDebugEnabled()).thenReturn(true);
    Mockito.when(mockLogger.isInfoEnabled()).thenReturn(true);
    Mockito.when(mockLogger.isWarnEnabled()).thenReturn(true);
    Mockito.when(mockLogger.isErrorEnabled()).thenReturn(true);

    Mockito.when(mockProject.getGradle().getStartParameter().getConsoleOutput())
        .thenReturn(ConsoleOutput.Plain);
    Mockito.when(mockProject.getObjects()).thenReturn(mockObjectFactory);
    Mockito.when(
            mockObjectFactory.newInstance(
                Mockito.eq(ExtensionDefinedFooConfig.class), Mockito.any()))
        .thenReturn(new ExtensionDefinedFooConfig("uninitialized"));
    Mockito.when(
            mockObjectFactory.newInstance(
                Mockito.eq(ExtensionDefinedBarConfig.class), Mockito.any()))
        .thenReturn(new ExtensionDefinedBarConfig("uninitialized"));

    gradleProjectProperties =
        new GradleProjectProperties(
            mockProject,
            mockLogger,
            mockTempDirectoryProvider,
            () -> loadedExtensions,
            JavaPlugin.RUNTIME_CLASSPATH_CONFIGURATION_NAME);
  }
Plugin extension test for {@link GradleProjectProperties}.
jib-gradle-plugin/src/test/java/com/google/cloud/tools/jib/gradle/GradleProjectPropertiesExtensionTest.java