@Test
  public void testRunPluginExtensions_ignoreUnexpectedExtraConfig()
      throws JibPluginExtensionException {
    BaseExtension<Void> extension =
        new BaseExtension<>(
            (buildPlan, properties, extraConfig, mavenData, logger) -> buildPlan, null);
    loadedExtensions = Arrays.asList(extension);

    ExtensionConfiguration extensionConfig =
        new BaseExtensionConfig<>(
            BaseExtension.class.getName(), Collections.emptyMap(), (ignored) -> {});
    try {
      gradleProjectProperties.runPluginExtensions(Arrays.asList(extensionConfig), containerBuilder);
      Assert.fail();
    } catch (IllegalArgumentException ex) {
      Assert.assertEquals(
          "extension BaseExtension does not expect extension-specific configuration; remove the "
              + "inapplicable 'pluginExtension.configuration' from Gradle build script",
          ex.getMessage());
    }
  }
Plugin extension test for {@link GradleProjectProperties}.
jib-gradle-plugin/src/test/java/com/google/cloud/tools/jib/gradle/GradleProjectPropertiesExtensionTest.java