diff --git a/agent-plugins/proxy-apache/pom.xml b/agent-plugins/proxy-apache/pom.xml index 640896f670ad6..9fdb72f8f8d0e 100644 --- a/agent-plugins/proxy-apache/pom.xml +++ b/agent-plugins/proxy-apache/pom.xml @@ -31,11 +31,6 @@ ${project.version} - - junit - junit - test - \ No newline at end of file diff --git a/agent-plugins/proxy-app/pom.xml b/agent-plugins/proxy-app/pom.xml index 65b437303ada2..064d4a891d71e 100644 --- a/agent-plugins/proxy-app/pom.xml +++ b/agent-plugins/proxy-app/pom.xml @@ -31,11 +31,6 @@ ${project.version} - - junit - junit - test - \ No newline at end of file diff --git a/agent-plugins/proxy-nginx/pom.xml b/agent-plugins/proxy-nginx/pom.xml index 8fd292e7b883a..a694ab66f2887 100644 --- a/agent-plugins/proxy-nginx/pom.xml +++ b/agent-plugins/proxy-nginx/pom.xml @@ -31,10 +31,5 @@ ${project.version} - - junit - junit - test - \ No newline at end of file diff --git a/agent-plugins/proxy-user/pom.xml b/agent-plugins/proxy-user/pom.xml index 673e5ea1ad6f6..1a5945f07ae75 100644 --- a/agent-plugins/proxy-user/pom.xml +++ b/agent-plugins/proxy-user/pom.xml @@ -31,10 +31,5 @@ ${project.version} - - junit - junit - test - \ No newline at end of file diff --git a/collector/src/test/java/com/navercorp/pinpoint/collector/util/ManagedAgentLifeCycleTest.java b/collector/src/test/java/com/navercorp/pinpoint/collector/util/ManagedAgentLifeCycleTest.java index d0351765bd001..5b929f4176685 100644 --- a/collector/src/test/java/com/navercorp/pinpoint/collector/util/ManagedAgentLifeCycleTest.java +++ b/collector/src/test/java/com/navercorp/pinpoint/collector/util/ManagedAgentLifeCycleTest.java @@ -1,7 +1,8 @@ package com.navercorp.pinpoint.collector.util; -import org.junit.Test; + import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; public class ManagedAgentLifeCycleTest { diff --git a/grpc/pom.xml b/grpc/pom.xml index ff0ae2f15c162..b7a8785785f04 100644 --- a/grpc/pom.xml +++ b/grpc/pom.xml @@ -167,11 +167,6 @@ org.apache.commons test - - junit - junit - test - diff --git a/plugins/hbase/src/test/java/com/navercorp/pinpoint/plugin/hbase/interceptor/data/DataSizeHelperTest.java b/plugins/hbase/src/test/java/com/navercorp/pinpoint/plugin/hbase/interceptor/data/DataSizeHelperTest.java index 71345e9b32775..5733ac165ee30 100644 --- a/plugins/hbase/src/test/java/com/navercorp/pinpoint/plugin/hbase/interceptor/data/DataSizeHelperTest.java +++ b/plugins/hbase/src/test/java/com/navercorp/pinpoint/plugin/hbase/interceptor/data/DataSizeHelperTest.java @@ -7,14 +7,15 @@ import org.apache.hadoop.hbase.client.Put; import org.apache.hadoop.hbase.client.Result; import org.apache.hadoop.hbase.client.RowMutations; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; + public class DataSizeHelperTest { diff --git a/pom.xml b/pom.xml index 9b5a0e127efb2..1aca164dfe985 100644 --- a/pom.xml +++ b/pom.xml @@ -223,11 +223,6 @@ - - junit - junit - test - org.hamcrest hamcrest diff --git a/profiler/pom.xml b/profiler/pom.xml index 2567e96741823..0c9ba5d958e00 100644 --- a/profiler/pom.xml +++ b/profiler/pom.xml @@ -197,12 +197,6 @@ --> - - - junit - junit - test - diff --git a/profiler/src/test/java/com/navercorp/pinpoint/profiler/context/CallStackFactoryV1Test.java b/profiler/src/test/java/com/navercorp/pinpoint/profiler/context/CallStackFactoryV1Test.java index 0bfc1e6156d18..1f0204c89f31b 100644 --- a/profiler/src/test/java/com/navercorp/pinpoint/profiler/context/CallStackFactoryV1Test.java +++ b/profiler/src/test/java/com/navercorp/pinpoint/profiler/context/CallStackFactoryV1Test.java @@ -16,9 +16,11 @@ package com.navercorp.pinpoint.profiler.context; -import org.junit.Test; -import static org.junit.Assert.*; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertNotNull; + public class CallStackFactoryV1Test { diff --git a/profiler/src/test/java/com/navercorp/pinpoint/profiler/context/CallStackFactoryV2Test.java b/profiler/src/test/java/com/navercorp/pinpoint/profiler/context/CallStackFactoryV2Test.java index d8477e0020b62..c55ee7ddf1c1e 100644 --- a/profiler/src/test/java/com/navercorp/pinpoint/profiler/context/CallStackFactoryV2Test.java +++ b/profiler/src/test/java/com/navercorp/pinpoint/profiler/context/CallStackFactoryV2Test.java @@ -16,9 +16,11 @@ package com.navercorp.pinpoint.profiler.context; -import org.junit.Test; -import static org.junit.Assert.*; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertNotNull; + public class CallStackFactoryV2Test { diff --git a/profiler/src/test/java/com/navercorp/pinpoint/profiler/context/DefaultCallStackOverflowListenerTest.java b/profiler/src/test/java/com/navercorp/pinpoint/profiler/context/DefaultCallStackOverflowListenerTest.java index 4beed4fb74327..27a5fb13b6809 100644 --- a/profiler/src/test/java/com/navercorp/pinpoint/profiler/context/DefaultCallStackOverflowListenerTest.java +++ b/profiler/src/test/java/com/navercorp/pinpoint/profiler/context/DefaultCallStackOverflowListenerTest.java @@ -16,9 +16,8 @@ package com.navercorp.pinpoint.profiler.context; -import org.junit.Test; -import static org.junit.Assert.*; +import org.junit.jupiter.api.Test; public class DefaultCallStackOverflowListenerTest { diff --git a/profiler/src/test/java/com/navercorp/pinpoint/profiler/context/ThrottledLogCallStackOverflowListenerTest.java b/profiler/src/test/java/com/navercorp/pinpoint/profiler/context/ThrottledLogCallStackOverflowListenerTest.java index d987ce4ae1b98..51397c9ca55bd 100644 --- a/profiler/src/test/java/com/navercorp/pinpoint/profiler/context/ThrottledLogCallStackOverflowListenerTest.java +++ b/profiler/src/test/java/com/navercorp/pinpoint/profiler/context/ThrottledLogCallStackOverflowListenerTest.java @@ -16,9 +16,8 @@ package com.navercorp.pinpoint.profiler.context; -import org.junit.Test; -import static org.junit.Assert.*; +import org.junit.jupiter.api.Test; public class ThrottledLogCallStackOverflowListenerTest { diff --git a/profiler/src/test/java/com/navercorp/pinpoint/profiler/context/provider/sampler/TraceSamplerProviderTest.java b/profiler/src/test/java/com/navercorp/pinpoint/profiler/context/provider/sampler/TraceSamplerProviderTest.java index 07ba65292ffad..b31fad3405bf6 100644 --- a/profiler/src/test/java/com/navercorp/pinpoint/profiler/context/provider/sampler/TraceSamplerProviderTest.java +++ b/profiler/src/test/java/com/navercorp/pinpoint/profiler/context/provider/sampler/TraceSamplerProviderTest.java @@ -22,15 +22,13 @@ import com.navercorp.pinpoint.profiler.context.config.DefaultContextConfig; import com.navercorp.pinpoint.profiler.context.id.AtomicIdGenerator; import com.navercorp.pinpoint.profiler.sampler.BasicTraceSampler; -import com.navercorp.pinpoint.profiler.sampler.RateLimitTraceSampler; import com.navercorp.pinpoint.profiler.sampler.TrueSampler; import com.navercorp.pinpoint.profiler.sampler.UrlTraceSampler; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; import java.util.Properties; -import static org.junit.Assert.*; public class TraceSamplerProviderTest { @@ -42,7 +40,7 @@ public void get() { TraceSamplerProvider provider = new TraceSamplerProvider(profilerConfig, new DefaultContextConfig(), TrueSampler.INSTANCE, new AtomicIdGenerator()); TraceSampler traceSampler = provider.get(); - assertNotNull(traceSampler); + Assertions.assertNotNull(traceSampler); } @Test @@ -57,7 +55,7 @@ public void getUrlSampler() { TraceSamplerProvider provider = new TraceSamplerProvider(profilerConfig, new DefaultContextConfig(), TrueSampler.INSTANCE, new AtomicIdGenerator()); TraceSampler traceSampler = provider.get(); if(Boolean.FALSE == (traceSampler instanceof UrlTraceSampler)) { - Assert.fail("Unexpected sampler type. traceSampler=" + traceSampler); + Assertions.fail("Unexpected sampler type. traceSampler=" + traceSampler); } } @@ -72,8 +70,8 @@ public void samplingEnableFalse() { TraceSamplerProvider provider = new TraceSamplerProvider(profilerConfig, new DefaultContextConfig(), TrueSampler.INSTANCE, new AtomicIdGenerator()); TraceSampler traceSampler = provider.get(); - if(Boolean.FALSE == (traceSampler instanceof BasicTraceSampler)) { - Assert.fail("Unexpected sampler type. traceSampler=" + traceSampler); + if (Boolean.FALSE == (traceSampler instanceof BasicTraceSampler)) { + Assertions.fail("Unexpected sampler type. traceSampler=" + traceSampler); } } @@ -88,8 +86,8 @@ public void urlSamplingEnableFalse() { TraceSamplerProvider provider = new TraceSamplerProvider(profilerConfig, new DefaultContextConfig(), TrueSampler.INSTANCE, new AtomicIdGenerator()); TraceSampler traceSampler = provider.get(); - if(Boolean.FALSE == (traceSampler instanceof BasicTraceSampler)) { - Assert.fail("Unexpected sampler type. traceSampler=" + traceSampler); + if (Boolean.FALSE == (traceSampler instanceof BasicTraceSampler)) { + Assertions.fail("Unexpected sampler type. traceSampler=" + traceSampler); } } } \ No newline at end of file diff --git a/profiler/src/test/java/com/navercorp/pinpoint/profiler/context/provider/sampler/UrlSamplerConfigTest.java b/profiler/src/test/java/com/navercorp/pinpoint/profiler/context/provider/sampler/UrlSamplerConfigTest.java index 5dc7759f37cbd..17756b366895f 100644 --- a/profiler/src/test/java/com/navercorp/pinpoint/profiler/context/provider/sampler/UrlSamplerConfigTest.java +++ b/profiler/src/test/java/com/navercorp/pinpoint/profiler/context/provider/sampler/UrlSamplerConfigTest.java @@ -19,13 +19,13 @@ import com.navercorp.pinpoint.bootstrap.config.ProfilerConfig; import com.navercorp.pinpoint.bootstrap.config.ProfilerConfigLoader; import com.navercorp.pinpoint.profiler.sampler.SamplerType; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; import java.util.List; import java.util.Map; import java.util.Properties; -import static org.junit.Assert.*; public class UrlSamplerConfigTest { @@ -36,7 +36,7 @@ public void emptyList() { UrlSamplerConfig urlSamplerConfig = new UrlSamplerConfig(profilerConfig, SamplerType.COUNTING); List> entryList = urlSamplerConfig.entryList(); - assertEquals(0, entryList.size()); + Assertions.assertEquals(0, entryList.size()); } @Test @@ -51,11 +51,11 @@ public void entryList() { UrlSamplerConfig urlSamplerConfig = new UrlSamplerConfig(profilerConfig, SamplerType.COUNTING); List> entryList = urlSamplerConfig.entryList(); UrlSamplerInfo urlInfo = entryList.get(0).getValue(); - assertEquals("/foo", urlInfo.getUrlPath()); - assertNotNull(urlInfo.getSampler()); - assertEquals(0, urlInfo.getSamplingNewThroughput()); - assertEquals(0, urlInfo.getSamplingContinueThroughput()); - assertTrue(urlInfo.isValid()); + Assertions.assertEquals("/foo", urlInfo.getUrlPath()); + Assertions.assertNotNull(urlInfo.getSampler()); + Assertions.assertEquals(0, urlInfo.getSamplingNewThroughput()); + Assertions.assertEquals(0, urlInfo.getSamplingContinueThroughput()); + Assertions.assertTrue(urlInfo.isValid()); } @Test @@ -68,8 +68,8 @@ public void notFoundSampler() { UrlSamplerConfig urlSamplerConfig = new UrlSamplerConfig(profilerConfig, SamplerType.COUNTING); List> entryList = urlSamplerConfig.entryList(); UrlSamplerInfo urlInfo = entryList.get(0).getValue(); - assertNull(urlInfo.getSampler()); - assertFalse(urlInfo.isValid()); + Assertions.assertNull(urlInfo.getSampler()); + Assertions.assertFalse(urlInfo.isValid()); } @Test @@ -80,6 +80,6 @@ public void invalidConfig() { UrlSamplerConfig urlSamplerConfig = new UrlSamplerConfig(profilerConfig, SamplerType.COUNTING); List> entryList = urlSamplerConfig.entryList(); - assertEquals(0, entryList.size()); + Assertions.assertEquals(0, entryList.size()); } } \ No newline at end of file diff --git a/profiler/src/test/java/com/navercorp/pinpoint/profiler/sampler/UrlTraceSamplerTest.java b/profiler/src/test/java/com/navercorp/pinpoint/profiler/sampler/UrlTraceSamplerTest.java index 6aced1321b3fb..bba472e8f446a 100644 --- a/profiler/src/test/java/com/navercorp/pinpoint/profiler/sampler/UrlTraceSamplerTest.java +++ b/profiler/src/test/java/com/navercorp/pinpoint/profiler/sampler/UrlTraceSamplerTest.java @@ -20,12 +20,15 @@ import com.navercorp.pinpoint.bootstrap.sampler.TraceSampler; import com.navercorp.pinpoint.profiler.context.id.AtomicIdGenerator; import com.navercorp.pinpoint.profiler.context.id.IdGenerator; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.util.LinkedHashMap; import java.util.Map; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + public class UrlTraceSamplerTest { static final String PATTERN1 = "/foo/*"; diff --git a/rpc/src/test/java/com/navercorp/pinpoint/rpc/common/SocketStateCodeTest.java b/rpc/src/test/java/com/navercorp/pinpoint/rpc/common/SocketStateCodeTest.java index 8dba000d411ba..9a65169992c33 100644 --- a/rpc/src/test/java/com/navercorp/pinpoint/rpc/common/SocketStateCodeTest.java +++ b/rpc/src/test/java/com/navercorp/pinpoint/rpc/common/SocketStateCodeTest.java @@ -1,7 +1,7 @@ package com.navercorp.pinpoint.rpc.common; -import org.junit.Test; import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; public class SocketStateCodeTest { diff --git a/web/src/test/java/com/navercorp/pinpoint/web/websocket/ActiveThreadCountResponseAggregatorTest.java b/web/src/test/java/com/navercorp/pinpoint/web/websocket/ActiveThreadCountResponseAggregatorTest.java index d83e63b7cbd3a..81abe4628ebcf 100644 --- a/web/src/test/java/com/navercorp/pinpoint/web/websocket/ActiveThreadCountResponseAggregatorTest.java +++ b/web/src/test/java/com/navercorp/pinpoint/web/websocket/ActiveThreadCountResponseAggregatorTest.java @@ -33,7 +33,7 @@ import java.util.List; import java.util.Timer; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyLong; import static org.mockito.ArgumentMatchers.eq; @@ -87,7 +87,7 @@ public void shouldActivateWorkerByAddingFirstSession() throws Exception { aggregator.start(); aggregator.addWebSocketSession(this.session); - assertEquals("# of sessions should be 1", 1, aggregator.countWebSocketSession()); + assertEquals(1, aggregator.countWebSocketSession(), "# of sessions should be 1"); verify(this.agentService, times(1)).getRecentAgentInfoList(eq(applicationName), anyLong()); verify(this.agentService, times(1)).openStream(eq(clusterKey), any(TBase.class), any()); @@ -99,18 +99,18 @@ public void shouldDeactivateWorkerByRemovingLastSession() { aggregator.addWebSocketSession(this.session); verify(this.channel, times(0)).close(); - assertEquals("# of sessions should be 1", 1, aggregator.countWebSocketSession()); + assertEquals(1, aggregator.countWebSocketSession(), "# of sessions should be 1"); aggregator.addWebSocketSession(session); verify(this.channel, times(0)).close(); - assertEquals("# of sessions should be 2", 2, aggregator.countWebSocketSession()); + assertEquals(2, aggregator.countWebSocketSession(), "# of sessions should be 2"); aggregator.removeWebSocketSessionAndGetIsCleared(session); verify(this.channel, times(0)).close(); - assertEquals("# of sessions should be 1", 1, aggregator.countWebSocketSession()); + assertEquals(1, aggregator.countWebSocketSession(), "# of sessions should be 1"); aggregator.removeWebSocketSessionAndGetIsCleared(session); verify(this.channel, times(1)).close(); - assertEquals("# of sessions should be 0", 0, aggregator.countWebSocketSession()); + assertEquals(0, aggregator.countWebSocketSession(), "# of sessions should be 0"); } }