@@ -616,13 +616,14 @@ void main_with_valid_existing_file_should_work_with_mocked_api() {
616616
617617 // Test with absolute path to pom.xml
618618 String absolutePomPath = System .getProperty ("user.dir" ) + "/pom.xml" ;
619+ ComponentAnalysisResult mockResult = new ComponentAnalysisResult (mockReport , null );
619620 try (MockedStatic <AppUtils > mockedAppUtils = mockStatic (AppUtils .class );
620621 MockedConstruction <ExhortApi > mockedExhortApi =
621622 mockConstruction (
622623 ExhortApi .class ,
623624 (mock , context ) -> {
624- when (mock .componentAnalysis (any (String .class )))
625- .thenReturn (CompletableFuture .completedFuture (mockReport ));
625+ when (mock .componentAnalysisWithLicense (any (String .class )))
626+ .thenReturn (CompletableFuture .completedFuture (mockResult ));
626627 })) {
627628
628629 App .main (new String [] {"component" , absolutePomPath });
@@ -696,13 +697,14 @@ void main_with_default_json_format_should_work_with_mocked_api() {
696697 }
697698
698699 // Test default JSON format for component command (no format flag)
700+ ComponentAnalysisResult mockResult2 = new ComponentAnalysisResult (mockReport , null );
699701 try (MockedStatic <AppUtils > mockedAppUtils = mockStatic (AppUtils .class );
700702 MockedConstruction <ExhortApi > mockedExhortApi =
701703 mockConstruction (
702704 ExhortApi .class ,
703705 (mock , context ) -> {
704- when (mock .componentAnalysis (any (String .class )))
705- .thenReturn (CompletableFuture .completedFuture (mockReport ));
706+ when (mock .componentAnalysisWithLicense (any (String .class )))
707+ .thenReturn (CompletableFuture .completedFuture (mockResult2 ));
706708 })) {
707709
708710 App .main (new String [] {"component" , "pom.xml" });
0 commit comments