diff --git a/spring/boot3-webflux-autoconfigure/src/test/java/com/linecorp/armeria/spring/web/reactive/ReactiveWebServerLoadBalancerInteropTest.java b/spring/boot3-webflux-autoconfigure/src/test/java/com/linecorp/armeria/spring/web/reactive/ReactiveWebServerLoadBalancerInteropTest.java index 48c50893de5..84b5d2d3856 100644 --- a/spring/boot3-webflux-autoconfigure/src/test/java/com/linecorp/armeria/spring/web/reactive/ReactiveWebServerLoadBalancerInteropTest.java +++ b/spring/boot3-webflux-autoconfigure/src/test/java/com/linecorp/armeria/spring/web/reactive/ReactiveWebServerLoadBalancerInteropTest.java @@ -22,6 +22,8 @@ import static org.springframework.web.reactive.function.server.RouterFunctions.route; import static org.springframework.web.reactive.function.server.ServerResponse.ok; +import java.util.List; +import java.util.concurrent.CopyOnWriteArrayList; import java.util.stream.Collectors; import org.junit.jupiter.api.AfterEach; @@ -50,7 +52,7 @@ import ch.qos.logback.classic.Logger; import ch.qos.logback.classic.spi.ILoggingEvent; -import ch.qos.logback.core.read.ListAppender; +import ch.qos.logback.core.AppenderBase; import reactor.core.publisher.Mono; @SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT) @@ -79,7 +81,7 @@ RouterFunction routerFunction() { int port; final Logger httpWebHandlerAdapterLogger = (Logger) LoggerFactory.getLogger(HttpWebHandlerAdapter.class); - final ListAppender logAppender = new ListAppender<>(); + final ConcurrentListAppender logAppender = new ConcurrentListAppender<>(); @BeforeEach public void attachAppender() { @@ -148,4 +150,14 @@ private void assertNoErrorLogByHttpWebHandlerAdapter() { .collect(Collectors.toList())) .isEmpty(); } + + private static final class ConcurrentListAppender extends AppenderBase { + + List list = new CopyOnWriteArrayList<>(); + + @Override + protected void append(E eventObject) { + list.add(eventObject); + } + } }