File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ void analyzeFailed() {
4545 when (goblintConfWatcher .refreshGoblintConfig ()).thenReturn (true );
4646
4747 // Mock that the analyses of Goblint have started and completed
48- when (goblintService .analyze (new AnalyzeParams (false ))).thenReturn (CompletableFuture .completedFuture ( null ));
48+ when (goblintService .analyze (new AnalyzeParams (false ))).thenReturn (CompletableFuture .failedFuture ( new Throwable ( " Testing failed analysis" ) ));
4949
5050 // Mock that the incremental analysis is turned off (TODO: not sure why this is checked in reanalyze?)
5151 when (gobPieConfiguration .useIncrementalAnalysis ()).thenReturn (true );
@@ -58,7 +58,11 @@ void analyzeFailed() {
5858
5959 // Verify that Analysis has failed
6060 assertTrue (systemOut .getLines ().anyMatch (line -> line .contains ("---------------------- Analysis started ----------------------" )));
61- //assertTrue(systemOut.getLines().anyMatch(line -> line.contains("--------------------- Analysis failed ----------------------")));
61+ assertTrue (systemOut .getLines ().anyMatch (line -> line .contains ("--------------------- Analysis failed ----------------------" )));
62+
63+ // Verify that user is notified about the failed analysis
64+ verify (magpieServer ).forwardMessageToClient (new MessageParams (MessageType .Info , "GobPie started analyzing the code." ));
65+ verify (magpieServer ).forwardMessageToClient (new MessageParams (MessageType .Error , "GobPie failed to analyze the code:\n Testing failed analysis" ));
6266 }
6367
6468
You can’t perform that action at this time.
0 commit comments