Provide a better error message when the mojo descriptor is null.
diff --git a/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/AbstractMojoTestCase.java b/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/AbstractMojoTestCase.java index 08cd9aa..a1c7a66 100644 --- a/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/AbstractMojoTestCase.java +++ b/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/AbstractMojoTestCase.java
@@ -409,7 +409,7 @@ protected MojoExecution newMojoExecution( String goal ) { MojoDescriptor mojoDescriptor = mojoDescriptors.get( goal ); - assertNotNull( mojoDescriptor ); + assertNotNull(String.format("The MojoDescriptor for the goal %s cannot be null.", goal), mojoDescriptor ); MojoExecution execution = new MojoExecution( mojoDescriptor ); finalizeMojoConfiguration( execution ); return execution;