@Test
  public void testRunPluginExtensions_wrongExtraConfigType() {
    FooExtension extension =
        new FooExtension((buildPlan, properties, extraConfig, mavenData, logger) -> buildPlan);
    loadedExtensions = Arrays.asList(extension);

    ExtensionConfiguration extensionConfig =
        new BaseExtensionConfig<>(
            FooExtension.class.getName(), Collections.emptyMap(), "string <configuration>");
    try {
      mavenProjectProperties.runPluginExtensions(Arrays.asList(extensionConfig), containerBuilder);
      Assert.fail();
    } catch (JibPluginExtensionException ex) {
      Assert.assertEquals(FooExtension.class, ex.getExtensionClass());
      Assert.assertEquals(
          "extension-specific <configuration> for FooExtension is not of type com.google.cloud"
              + ".tools.jib.maven.MavenProjectPropertiesExtensionTest$ExtensionDefinedFooConfig "
              + "but java.lang.String; specify the correct type with <pluginExtension>"
              + "<configuration implementation=\"com.google.cloud.tools.jib.maven."
              + "MavenProjectPropertiesExtensionTest$ExtensionDefinedFooConfig\">",
          ex.getMessage());
    }
  }
Plugin extension test for {@link MavenProjectProperties}.
jib-maven-plugin/src/test/java/com/google/cloud/tools/jib/maven/MavenProjectPropertiesExtensionTest.java