I'm struggling to find out how to ignore a class method, which should start a thread when SpringBootApplication is ready, during normal operation:
@EventListener
public void onApplicationEvent(ContextRefreshedEvent event) {
this.start();
}
in case of testing I do not want such behavior, want to start it from test method.
As far as i understand ContextRefreshedEvent is triggered by @SpringBootTest annotation on test class.