From 50e8e78ae3bfac871a31bd55264ce077856990b0 Mon Sep 17 00:00:00 2001 From: sullis Date: Sun, 18 Feb 2024 11:10:34 -0800 Subject: [PATCH] use NettyLeakDetectorExtension --- build.gradle | 1 + reactor-netty-http/build.gradle | 3 ++- .../src/test/java/reactor/netty/BaseHttpTest.java | 5 ++++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index a3305934fc..90952b7d04 100644 --- a/build.gradle +++ b/build.gradle @@ -126,6 +126,7 @@ ext { assertJVersion = '3.25.3' awaitilityVersion = '4.2.0' hoverflyJavaVersion = '0.16.1' + nettyLeakDetectorJunitExtensionVersion = "0.0.1" tomcatVersion = '9.0.86' boringSslVersion = '2.0.63.Final' junitVersion = '5.10.2' diff --git a/reactor-netty-http/build.gradle b/reactor-netty-http/build.gradle index 02b717a633..3f8432db5c 100644 --- a/reactor-netty-http/build.gradle +++ b/reactor-netty-http/build.gradle @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2023 VMware, Inc. or its affiliates, All Rights Reserved. + * Copyright (c) 2020-2024 VMware, Inc. or its affiliates, All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -132,6 +132,7 @@ dependencies { testImplementation "org.mockito:mockito-core:$mockitoVersion" testImplementation "io.specto:hoverfly-java-junit5:$hoverflyJavaVersion" + testImplementation "io.github.nettyplus:netty-leak-detector-junit-extension:$nettyLeakDetectorJunitExtensionVersion" testImplementation "org.apache.tomcat.embed:tomcat-embed-core:$tomcatVersion" testImplementation "io.projectreactor:reactor-test:$testAddonVersion" testImplementation "org.assertj:assertj-core:$assertJVersion" diff --git a/reactor-netty-http/src/test/java/reactor/netty/BaseHttpTest.java b/reactor-netty-http/src/test/java/reactor/netty/BaseHttpTest.java index 9e6633dc59..94ff451a50 100644 --- a/reactor-netty-http/src/test/java/reactor/netty/BaseHttpTest.java +++ b/reactor-netty-http/src/test/java/reactor/netty/BaseHttpTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 VMware, Inc. or its affiliates, All Rights Reserved. + * Copyright (c) 2021-2024 VMware, Inc. or its affiliates, All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,9 @@ */ package reactor.netty; +import io.github.nettyplus.leakdetector.junit.NettyLeakDetectorExtension; import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.params.provider.Arguments; import reactor.netty.http.HttpProtocol; import reactor.netty.http.client.HttpClient; @@ -34,6 +36,7 @@ * @author Violeta Georgieva * @since 1.0.3 */ +@ExtendWith(NettyLeakDetectorExtension.class) public class BaseHttpTest { protected DisposableServer disposableServer;