Polish LogbackRuntimeHintsRegistrarTests

See gh-31074
This commit is contained in:
izeye 2022-05-17 19:39:14 +09:00 committed by Stephane Nicoll
parent 7740e7bd0a
commit 74a8fffe9f
1 changed files with 2 additions and 4 deletions

View File

@ -47,7 +47,7 @@ import static org.assertj.core.api.Assertions.assertThat;
class LogbackRuntimeHintsRegistrarTests { class LogbackRuntimeHintsRegistrarTests {
@Test @Test
void registersHintsForTypesCheckedByLogbackLoggingSystem() throws Exception { void registersHintsForTypesCheckedByLogbackLoggingSystem() {
ReflectionHints reflection = registerHints(); ReflectionHints reflection = registerHints();
assertThat(reflection.getTypeHint(LoggerContext.class)).isNotNull(); assertThat(reflection.getTypeHint(LoggerContext.class)).isNotNull();
assertThat(reflection.getTypeHint(SLF4JBridgeHandler.class)).isNotNull(); assertThat(reflection.getTypeHint(SLF4JBridgeHandler.class)).isNotNull();
@ -55,14 +55,12 @@ class LogbackRuntimeHintsRegistrarTests {
@Test @Test
void registersHintsForBuiltInLogbackConverters() throws Exception { void registersHintsForBuiltInLogbackConverters() throws Exception {
RuntimeHints hints = new RuntimeHints();
new LogbackRuntimeHintsRegistrar().registerHints(hints, getClass().getClassLoader());
ReflectionHints reflection = registerHints(); ReflectionHints reflection = registerHints();
assertThat(logbackConverters()).allSatisfy(registeredForPublicConstructorInvocation(reflection)); assertThat(logbackConverters()).allSatisfy(registeredForPublicConstructorInvocation(reflection));
} }
@Test @Test
void registersHintsForSpringBootConverters() throws IOException, ClassNotFoundException, LinkageError { void registersHintsForSpringBootConverters() throws LinkageError {
ReflectionHints reflection = registerHints(); ReflectionHints reflection = registerHints();
assertThat(List.of(ColorConverter.class, ExtendedWhitespaceThrowableProxyConverter.class, assertThat(List.of(ColorConverter.class, ExtendedWhitespaceThrowableProxyConverter.class,
WhitespaceThrowableProxyConverter.class)) WhitespaceThrowableProxyConverter.class))