void () { final SMTestProxy myTest1 = startTestWithPrinter("my_test"); myEventsProcessor.onError("error msg", "method1:1\nmethod2:2", true); myEventsProcessor.onTestOutput(new TestOutputEvent("my_test", "stdout1 ", true)); myEventsProcessor.onTestOutput(new TestOutputEvent("my_test", "stderr1 ", false)); assertAllOutputs(myMockResettablePrinter, "stdout1 ", "\nerror msg\nmethod1:1\nmethod2:2\nstderr1 ", ""); final MockPrinter mockPrinter1 = new MockPrinter(); mockPrinter1.onNewAvailable(myTest1); assertAllOutputs(mockPrinter1, "stdout1 ", """ error msg method1:1 method2:2 stderr1\s""", ""); myEventsProcessor.onTestFinished(new TestFinishedEvent("my_test", 1L)); myTest1.setFinished(); //other output order final SMTestProxy myTest2 = startTestWithPrinter("my_test2"); myEventsProcessor.onTestOutput(new TestOutputEvent("my_test2", "stdout1 ", true)); myEventsProcessor.onTestOutput(new TestOutputEvent("my_test2", "stderr1 ", false)); myEventsProcessor.onError("error msg", "method1:1\nmethod2:2", true); assertAllOutputs(myMockResettablePrinter, "stdout1 ", "stderr1 \nerror msg\nmethod1:1\nmethod2:2\n", ""); final MockPrinter mockPrinter2 = new MockPrinter(); mockPrinter2.onNewAvailable(myTest2); assertAllOutputs(mockPrinter2, "stdout1 ", "stderr1 \nerror msg\nmethod1:1\nmethod2:2\n", ""); }