Могу ли я утверждать о регистраторе Lombok @Slf4j? ⇐ JAVA
-
Anonymous
Могу ли я утверждать о регистраторе Lombok @Slf4j?
Suppose I want to test that this method prints a log.warn message if the Flux is empty
@Slf4j class SomeClass { void someMethod(Flux intFlux) { intFlux.switchIfEmpty(Mono.defer(() -> { log.warn("No integers!"); return Mono.empty(); })) .subscribe(/* consume */); } } How can I do it? Specifically, how can I assert on Lombok's logger, if it's at all possible? It's not passed into the constructor, I can't mock() and verify(). Is it the only option to simply get rid of Lombok?
Источник: https://stackoverflow.com/questions/781 ... f4j-logger
Suppose I want to test that this method prints a log.warn message if the Flux is empty
@Slf4j class SomeClass { void someMethod(Flux intFlux) { intFlux.switchIfEmpty(Mono.defer(() -> { log.warn("No integers!"); return Mono.empty(); })) .subscribe(/* consume */); } } How can I do it? Specifically, how can I assert on Lombok's logger, if it's at all possible? It's not passed into the constructor, I can't mock() and verify(). Is it the only option to simply get rid of Lombok?
Источник: https://stackoverflow.com/questions/781 ... f4j-logger