I am transitioning from junit4 to junit5 on a project and trying to figure out how to test logs. Previously, I used
@Rule
OutputCapture outputCapture = new OutputCapture();
and would then write an assertion using outputCapture.toString()
, for example
assertThat(outputCapture.toString(),containsString("status=200"));
Since @Rule
annotation hasn't been implemented yet in junit5, I can't use outputCapture. Any ideas what to do instead? Thanks!