@Test
  public void testRunPluginExtensions() throws JibPluginExtensionException {
    FooExtension extension =
        new FooExtension(
            (buildPlan, properties, extraConfig, gradleData, logger) -> {
              logger.log(LogLevel.ERROR, "awesome error from my extension");
              return buildPlan.toBuilder().setUser("user from extension").build();
            });
    loadedExtensions = Arrays.asList(extension);

    JibContainerBuilder extendedBuilder =
        gradleProjectProperties.runPluginExtensions(
            Arrays.asList(new FooExtensionConfig()), containerBuilder);
    Assert.assertEquals("user from extension", extendedBuilder.toContainerBuildPlan().getUser());

    gradleProjectProperties.waitForLoggingThread();
    Mockito.verify(mockLogger).error("awesome error from my extension");
    Mockito.verify(mockLogger)
        .lifecycle(
            Mockito.startsWith(
                "Running extension: com.google.cloud.tools.jib.gradle.GradleProjectProperties"));
  }
Plugin extension test for {@link GradleProjectProperties}.
jib-gradle-plugin/src/test/java/com/google/cloud/tools/jib/gradle/GradleProjectPropertiesExtensionTest.java