In my service I have conditions that should log an error if it's true. I would like test that in Junit test. How can I do that ?
package com.omb;
@Log4j2
@Component
@RequiredArgsConstructor
public class MyService {
public void doSomething() {
log.error("Log an error !");
}
}