@ParameterizedTest
    @ValueSource(strings = { "ClassNotFound", "UnknownModule" })
    public void testPomErrors(String testCaseName) throws Exception {
        File testCaseLocation = new File("src/test/resources/error-test-cases");
        Assertions.assertThrows(MojoExecutionException.class,
                () -> executePom(new File(testCaseLocation, testCaseName + "-pom.xml")));
    }
Unit test that will generate from a maven pom file fragment and expect a MojoExecutionException.

@param testCaseName Name of the test case and file name prefix of the example {@code pom.xml}
@throws Exception In case something goes wrong
jsonschema-maven-plugin/src/test/java/com/github/victools/jsonschema/plugin/maven/SchemaGeneratorMojoTest.java