Repository: pinpoint-apm/pinpoint
Issue: Update library dependency versions
Labels: enhancement
module:project-common

#### Description
Update various library versions :
* ASM : 5.1 -> 5.2
* Guava : 19.0 -> 20.0
* Mockito : mockito-all 1.10.19 -> mockito-core 2.7.22
* commons-beanutils : 1.8.3 -> 1.9.3
* aspectjweaver : 1.8.9 -> 1.8.10
* Spring : 4.1.9.RELEASE -> 4.3.8.RELEASE
* Spring Batch : 2.2.7.RELEASE -> 3.0.7.RELEASE
* Spring Security : 4.0.4.RELEASE -> 4.2.2.RELEASE

Issue comments:

Pull request review comments:

Patch that resolved the issue:
diff --git a/pom.xml b/pom.xml
index de5d9b3e89f6..2d580d19c9b3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -80,9 +80,9 @@
         <httpcomponents.version>4.3</httpcomponents.version>
         <jedis.version>2.4.2</jedis.version>
         <cloverLicenseLocation>${basedir}/clover.license</cloverLicenseLocation>
-        <spring.version>4.1.9.RELEASE</spring.version>
-        <spring.batch.version>2.2.7.RELEASE</spring.batch.version>
-        <spring.security.version>4.0.4.RELEASE</spring.security.version>
+        <spring.version>4.3.8.RELEASE</spring.version>
+        <spring.batch.version>3.0.7.RELEASE</spring.batch.version>
+        <spring.security.version>4.2.2.RELEASE</spring.security.version>
         <docker.maven.plugin.version>0.4.3</docker.maven.plugin.version>
         <cassandra.driver.version>2.1.7.1</cassandra.driver.version>
         <sniffer.artifactid>java16</sniffer.artifactid>
@@ -101,7 +101,7 @@
         </dependency>
         <dependency>
             <groupId>org.mockito</groupId>
-            <artifactId>mockito-all</artifactId>
+            <artifactId>mockito-core</artifactId>
             <scope>test</scope>
         </dependency>
     </dependencies>
@@ -538,7 +538,7 @@
             <dependency>
                 <groupId>commons-beanutils</groupId>
                 <artifactId>commons-beanutils</artifactId>
-                <version>1.8.3</version>
+                <version>1.9.3</version>
             </dependency>
 
             <dependency>
@@ -569,13 +569,13 @@
             <dependency>
                 <groupId>org.ow2.asm</groupId>
                 <artifactId>asm-debug-all</artifactId>
-                <version>5.1</version>
+                <version>5.2</version>
             </dependency>
 
             <dependency>
                 <groupId>org.aspectj</groupId>
                 <artifactId>aspectjweaver</artifactId>
-                <version>1.8.9</version>
+                <version>1.8.10</version>
             </dependency>
 
 
@@ -621,8 +621,8 @@
             </dependency>
             <dependency>
                 <groupId>org.mockito</groupId>
-                <artifactId>mockito-all</artifactId>
-                <version>1.10.19</version>
+                <artifactId>mockito-core</artifactId>
+                <version>2.7.22</version>
             </dependency>
             <dependency>
                 <groupId>org.dbunit</groupId>
@@ -679,7 +679,7 @@
             <dependency>
                 <groupId>com.google.guava</groupId>
                 <artifactId>guava</artifactId>
-                <version>19.0</version>
+                <version>20.0</version>
             </dependency>
             <dependency>
                 <groupId>com.google.inject</groupId>
diff --git a/profiler/src/main/java/com/navercorp/pinpoint/profiler/instrument/ASMClassNodeAdapter.java b/profiler/src/main/java/com/navercorp/pinpoint/profiler/instrument/ASMClassNodeAdapter.java
index 3bff20f2273f..0252f99c8b15 100644
--- a/profiler/src/main/java/com/navercorp/pinpoint/profiler/instrument/ASMClassNodeAdapter.java
+++ b/profiler/src/main/java/com/navercorp/pinpoint/profiler/instrument/ASMClassNodeAdapter.java
@@ -47,8 +47,11 @@ public static ASMClassNodeAdapter get(final InstrumentContext pluginContext, fin
     }
 
     public static ASMClassNodeAdapter get(final InstrumentContext pluginContext, final ClassLoader classLoader, final String classInternalName, final boolean skipCode) {
-        if (pluginContext == null || classInternalName == null) {
-            throw new IllegalArgumentException("plugin context or class name must not be null.");
+        if (pluginContext == null) {
+            throw new NullPointerException("pluginContext must not be null");
+        }
+        if (classInternalName == null) {
+            throw new NullPointerException("classInternalName must not be null");
         }
 
         InputStream in = null;


Test patch:
diff --git a/profiler/src/test/java/com/navercorp/pinpoint/profiler/instrument/ASMClassNodeAdapterTest.java b/profiler/src/test/java/com/navercorp/pinpoint/profiler/instrument/ASMClassNodeAdapterTest.java
index 90e38086d2e6..3327195fd8e5 100644
--- a/profiler/src/test/java/com/navercorp/pinpoint/profiler/instrument/ASMClassNodeAdapterTest.java
+++ b/profiler/src/test/java/com/navercorp/pinpoint/profiler/instrument/ASMClassNodeAdapterTest.java
@@ -216,7 +216,7 @@ public void handle(ClassNode classNode) {
 
     @Test
     public void hasAnnotation() throws Exception {
-        ASMClassNodeAdapter classNodeAdapter = ASMClassNodeAdapter.get(pluginContext, null, "com/navercorp/pinpoint/profiler/instrument/mock/AnnotationClass");
+        ASMClassNodeAdapter classNodeAdapter = ASMClassNodeAdapter.get(pluginContext, ASMClassNodeLoader.getClassLoader(), "com/navercorp/pinpoint/profiler/instrument/mock/AnnotationClass");
         Assert.assertTrue(classNodeAdapter.hasAnnotation(Aspect.class));
         Assert.assertFalse(classNodeAdapter.hasAnnotation(Override.class));
     }
@@ -243,7 +243,7 @@ public void handle(ClassNode classNode) {
 
     @Test
     public void subclassOf() {
-        ASMClassNodeAdapter adapter = ASMClassNodeAdapter.get(pluginContext, null, "com/navercorp/pinpoint/profiler/instrument/mock/ExtendedClass");
+        ASMClassNodeAdapter adapter = ASMClassNodeAdapter.get(pluginContext, ASMClassNodeLoader.getClassLoader(), "com/navercorp/pinpoint/profiler/instrument/mock/ExtendedClass");
         // self
         assertEquals(true, adapter.subclassOf("com/navercorp/pinpoint/profiler/instrument/mock/ExtendedClass"));
 
diff --git a/profiler/src/test/java/com/navercorp/pinpoint/profiler/instrument/ASMClassWriterTest.java b/profiler/src/test/java/com/navercorp/pinpoint/profiler/instrument/ASMClassWriterTest.java
index 0a2a248f44e5..7fc68f0aee53 100644
--- a/profiler/src/test/java/com/navercorp/pinpoint/profiler/instrument/ASMClassWriterTest.java
+++ b/profiler/src/test/java/com/navercorp/pinpoint/profiler/instrument/ASMClassWriterTest.java
@@ -19,6 +19,7 @@
 import com.navercorp.pinpoint.profiler.util.JavaAssistUtils;
 import org.junit.Before;
 import org.junit.Test;
+import org.mockito.ArgumentMatchers;
 import org.mockito.invocation.InvocationOnMock;
 import org.mockito.stubbing.Answer;
 import org.objectweb.asm.tree.ClassNode;
@@ -28,6 +29,7 @@
 import java.io.PrintWriter;
 
 import static org.junit.Assert.*;
+import static org.mockito.ArgumentMatchers.anyString;
 import static org.mockito.Matchers.any;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
@@ -42,7 +44,7 @@ public class ASMClassWriterTest {
 
     @Before
     public void setUp() {
-        when(pluginContext.injectClass(any(ClassLoader.class), any(String.class))).thenAnswer(new Answer<Class<?>>() {
+        when(pluginContext.injectClass(ArgumentMatchers.<ClassLoader>isNull(), anyString())).thenAnswer(new Answer<Class<?>>() {
 
             @Override
             public Class<?> answer(InvocationOnMock invocation) throws Throwable {
@@ -53,7 +55,7 @@ public Class<?> answer(InvocationOnMock invocation) throws Throwable {
             }
 
         });
-        when(pluginContext.getResourceAsStream(any(ClassLoader.class), any(String.class))).thenAnswer(new Answer<InputStream>() {
+        when(pluginContext.getResourceAsStream(ArgumentMatchers.<ClassLoader>isNull(), anyString())).thenAnswer(new Answer<InputStream>() {
 
             @Override
             public InputStream answer(InvocationOnMock invocation) throws Throwable {
diff --git a/profiler/src/test/java/com/navercorp/pinpoint/profiler/monitor/CollectJobTest.java b/profiler/src/test/java/com/navercorp/pinpoint/profiler/monitor/CollectJobTest.java
index 3fb01a5c0f0b..bc14c804ceb9 100644
--- a/profiler/src/test/java/com/navercorp/pinpoint/profiler/monitor/CollectJobTest.java
+++ b/profiler/src/test/java/com/navercorp/pinpoint/profiler/monitor/CollectJobTest.java
@@ -28,6 +28,7 @@
 import com.navercorp.pinpoint.profiler.sender.DataSender;
 import com.navercorp.pinpoint.profiler.util.TestInterceptorRegistryBinder;
 import com.navercorp.pinpoint.thrift.dto.TAgentStat;
+import com.navercorp.pinpoint.thrift.dto.TAgentStatBatch;
 import org.junit.Test;
 import org.mockito.Mockito;
 
@@ -52,7 +53,7 @@ public void run() throws Exception {
         CollectJob job = new CollectJob(dataSender, "agent", 0, agentStatMetricCollector, 1);
         job.run();
 
-        Mockito.verify(dataSender).send(any(TAgentStat.class));
+        Mockito.verify(dataSender).send(any(TAgentStatBatch.class));
 
     }