Annotation Interface MessageKeyInspection
@Inherited
@Target({TYPE,METHOD})
@Retention(RUNTIME)
@ExtendWith(MessageKeyInspectionExtension.class) @ExtendWith(MessageKeyWatcherResolver.class)
public @interface MessageKeyInspection
Injects the ability to watch for a log messages being triggered.
For watching a multiple message-keys, see
LoggingInspections-
Required Element Summary
Required ElementsModifier and TypeRequired ElementDescriptionThe logger to watch onThe message key to look for. -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionbooleanWhether to reset the watcher before each test method.
-
Element Details
-
messageKey
String messageKeyThe message key to look for.- API Note:
- This is effectively a starts-with check. We simply check that the logged message starts with the value from here
-
logger
Logger loggerThe logger to watch on -
resetBeforeEach
boolean resetBeforeEachWhether to reset the watcher before each test method.- Default:
true
-