AbstractStructuredLoggingTests Class — spring-boot Architecture
Architecture documentation for the AbstractStructuredLoggingTests class in AbstractStructuredLoggingTests.java from the spring-boot codebase.
Entity Profile
Relationship Graph
Source Code
core/spring-boot/src/test/java/org/springframework/boot/logging/log4j2/AbstractStructuredLoggingTests.java lines 43–86
@ExtendWith(MockitoExtension.class)
abstract class AbstractStructuredLoggingTests {
static final Instant EVENT_TIME = Instant.ofEpochMilli(1719910193000L);
private static final JsonMapper JSON_MAPPER = new JsonMapper();
@Mock
@SuppressWarnings("NullAway.Init")
StructuredLoggingJsonMembersCustomizer<?> customizer;
MockStructuredLoggingJsonMembersCustomizerBuilder<?> customizerBuilder = new MockStructuredLoggingJsonMembersCustomizerBuilder<>(
() -> this.customizer);
protected Map<String, Object> map(Object... values) {
assertThat(values.length).isEven();
Map<String, Object> result = new HashMap<>();
for (int i = 0; i < values.length; i += 2) {
result.put(values[i].toString(), values[i + 1]);
}
return result;
}
protected static MutableLogEvent createEvent() {
return createEvent(null);
}
protected static MutableLogEvent createEvent(@Nullable Throwable thrown) {
MutableLogEvent event = new MutableLogEvent();
event.setTimeMillis(EVENT_TIME.toEpochMilli());
event.setLevel(Level.INFO);
event.setThreadName("main");
event.setLoggerName("org.example.Test");
event.setMessage(new SimpleMessage("message"));
event.setThrown(thrown);
return event;
}
protected Map<String, Object> deserialize(String json) {
return JSON_MAPPER.readValue(json, new TypeReference<>() {
});
}
}
Domain
Source
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free