Giovds commented on code in PR #783: URL: https://github.com/apache/maven/pull/783#discussion_r966412679
########## maven-embedder/src/test/java/org/apache/maven/cli/event/ExecutionEventLoggerTest.java: ########## @@ -191,6 +194,80 @@ public void testProjectStartedNoPom() inOrder.verify( logger ).info( "--------------------------------[ pom ]---------------------------------" ); } + @Test + void testMultiModuleProjectProgress() + { + // prepare + MavenProject project1 = generateMavenProject("Apache Maven Embedder 1"); + MavenProject project2 = generateMavenProject("Apache Maven Embedder 2"); + MavenProject project3 = generateMavenProject("Apache Maven Embedder 3"); + + MavenSession session = mock( MavenSession.class ); + when( session.getProjects() ).thenReturn( ImmutableList.of( project1, project2, project3 ) ); + when( session.getAllProjects() ).thenReturn( ImmutableList.of( project1, project2, project3 ) ); + + ExecutionEvent sessionStartedEvent = mock( ExecutionEvent.class ); + when( sessionStartedEvent.getSession() ).thenReturn( session ); + ExecutionEvent projectStartedEvent1 = mock( ExecutionEvent.class ); + when( projectStartedEvent1.getProject() ).thenReturn( project1 ); + ExecutionEvent projectStartedEvent2 = mock( ExecutionEvent.class ); + when( projectStartedEvent2.getProject() ).thenReturn( project2 ); + ExecutionEvent projectStartedEvent3 = mock( ExecutionEvent.class ); + when( projectStartedEvent3.getProject() ).thenReturn( project3 ); + + // execute + executionEventLogger.sessionStarted( sessionStartedEvent ); + executionEventLogger.projectStarted( projectStartedEvent1 ); + executionEventLogger.projectStarted( projectStartedEvent2 ); + executionEventLogger.projectStarted( projectStartedEvent3 ); + + // verify + InOrder inOrder = inOrder( logger ); + inOrder.verify( logger ).info( "Building Apache Maven Embedder 1 3.5.4-SNAPSHOT [1/3]" ); Review Comment: It might be an idea to validate just the counter and the project name? This way the test cases will not fail if it's decided to change the amount of whitespaces, or when the wording of the sentence changes for example. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org