I do have a simple class like this:
package com.example.howtomocktest import groovy.util.logging.Slf4j import java.nio.channels.NotYetBoundException @Slf4j
If you are using Spring, you have acces to OutputCaptureRule
@Rule OutputCaptureRule outputCaptureRule = new OutputCaptureRule() def test(){ outputCaptureRule.getAll().contains("") }