Skip to content

Commit b676cb4

Browse files
committed
Fix test
1 parent 2f7b2b4 commit b676cb4

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

maven-core/src/test/java/org/apache/maven/project/ProjectBuilderTest.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929

3030
import org.apache.commons.io.FileUtils;
3131
import org.apache.maven.AbstractCoreMavenComponentTestCase;
32+
import org.apache.maven.artifact.InvalidArtifactRTException;
3233
import org.apache.maven.execution.MavenSession;
3334
import org.apache.maven.model.Plugin;
3435
import org.apache.maven.model.building.FileModelSource;
@@ -236,17 +237,18 @@ public void testReadInvalidPom()
236237
getContainer().lookup( org.apache.maven.project.ProjectBuilder.class );
237238

238239
// single project build entry point
239-
Exception ex = assertThrows( Exception.class, () -> projectBuilder.build( pomFile, configuration ) );
240-
assertThat( ex.getMessage(), containsString( "expected START_TAG or END_TAG not TEXT" ) );
240+
InvalidArtifactRTException ex = assertThrows( InvalidArtifactRTException.class, () -> projectBuilder.build( pomFile, configuration ) );
241+
assertThat( ex.getMessage(), containsString( "The groupId cannot be empty." ) );
241242

242243
// multi projects build entry point
243244
ProjectBuildingException pex =
244245
assertThrows( ProjectBuildingException.class,
245246
() -> projectBuilder.build( Collections.singletonList( pomFile ), false, configuration ) );
246247
assertEquals( 1, pex.getResults().size() );
247248
assertNotNull( pex.getResults().get( 0 ).getPomFile() );
249+
assertNotNull( pex.getResults().get( 0 ).getProject() );
248250
assertThat( pex.getResults().get( 0 ).getProblems().size(), greaterThan( 0 ) );
249-
assertThat( pex.getResults(), contains( projectBuildingResultWithProblemMessage( "expected START_TAG or END_TAG not TEXT" ) ) );
251+
assertThat( pex.getResults(), contains( projectBuildingResultWithProblemMessage( "'groupId' is missing." ) ) );
250252
}
251253

252254
@Test

0 commit comments

Comments
 (0)