spring-projects / spring-lifecycle-smoke-tests

26 stars 19 forks source link

Expose Output on AssertableOutput #16

Closed garyrussell closed 1 year ago

garyrussell commented 1 year ago

To help debug an issue I am looking at, I had to add:

Output out = (Output) new DirectFieldAccessor(output).getPropertyValue("output");
out.outputLines().forEach(line -> System.out.println(line));

It would be useful if it provided getOutput().

sdeleuze commented 1 year ago

Hi Gary, can't it be accessed via Output.current()?

garyrussell commented 1 year ago

@sdeleuze That works, but it creates a new Output instance; it would be (slightly) more efficient to use the AssertableOutput.output.