]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-13155 upgrade testing dependencies
authorSimon Brandhof <simon.brandhof@sonarsource.com>
Tue, 17 Mar 2020 12:15:21 +0000 (13:15 +0100)
committersonartech <sonartech@sonarsource.com>
Sat, 21 Mar 2020 20:04:02 +0000 (20:04 +0000)
build.gradle
server/sonar-webserver-webapi/src/test/java/org/sonar/server/ce/ws/SubmitActionTest.java
server/sonar-webserver-webapi/src/test/java/org/sonar/server/qualityprofile/ws/ActivateRuleActionTest.java
server/sonar-webserver-webapi/src/test/java/org/sonar/server/qualityprofile/ws/DeactivateRuleActionTest.java
sonar-scanner-engine/src/test/java/org/sonar/scanner/cpd/JavaCpdBlockIndexerSensorTest.java
sonar-scanner-engine/src/test/java/org/sonar/scanner/scan/branch/BranchConfigurationProviderTest.java
sonar-testing-ldap/build.gradle

index e0cd60167b6cf5c2f898132ef5fc1068e8f01039..4002f46fc01c12a110077bccbbdda6102ab35e11 100644 (file)
@@ -208,17 +208,17 @@ subprojects {
         entry 'okhttp'
         entry 'mockwebserver'
       }
-      dependency 'com.tngtech.java:junit-dataprovider:1.9.2'
+      dependency 'com.tngtech.java:junit-dataprovider:1.13.1'
       dependency 'info.picocli:picocli:3.6.1'
       dependency "io.jsonwebtoken:jjwt-api:${jjwtVersion}"
       dependency "io.jsonwebtoken:jjwt-impl:${jjwtVersion}"
       dependency "io.jsonwebtoken:jjwt-jackson:${jjwtVersion}"
-      dependency 'io.netty:netty-all:4.0.51.Final'
+      dependency 'io.netty:netty-all:4.1.48.Final'
       dependency 'com.sun.mail:javax.mail:1.5.6'
       dependency 'javax.annotation:javax.annotation-api:1.3.1'
       dependency 'javax.servlet:javax.servlet-api:3.1.0'
       dependency 'javax.xml.bind:jaxb-api:2.3.0'
-      dependency 'junit:junit:4.12'
+      dependency 'junit:junit:4.13'
       dependency 'org.junit.jupiter:junit-jupiter-api:5.5.2'
       dependency 'net.jpountz.lz4:lz4:1.3.0'
       dependency 'net.lightbody.bmp:littleproxy:1.1.0-beta-bmp-17'
@@ -279,7 +279,7 @@ subprojects {
       dependency 'org.hamcrest:hamcrest-all:1.3'
       dependency 'org.jsoup:jsoup:1.12.1'
       dependency 'org.mindrot:jbcrypt:0.4'
-      dependency('org.mockito:mockito-core:3.1.0') {
+      dependency('org.mockito:mockito-core:3.3.3') {
         exclude 'org.hamcrest:hamcrest-core'
       }
       dependency 'org.mybatis:mybatis:3.5.4'
index 1a55827fb7d5ce157fe6b415ecfc3dc834b50ee7..8fce2030533f01a4427c90de52122bf34e754541 100644 (file)
@@ -22,11 +22,8 @@ package org.sonar.server.ce.ws;
 import com.google.common.base.Strings;
 import java.io.ByteArrayInputStream;
 import java.util.Map;
-import org.junit.Before;
 import org.junit.Test;
 import org.mockito.ArgumentCaptor;
-import org.mockito.Captor;
-import org.mockito.MockitoAnnotations;
 import org.sonar.ce.task.CeTask;
 import org.sonar.db.ce.CeTaskTypes;
 import org.sonar.server.ce.queue.ReportSubmitter;
@@ -61,20 +58,13 @@ public class SubmitActionTest {
     .setSubmitter(new CeTask.User("UUID_1", "LOGIN_1"))
     .build();
 
-  @Captor
-  ArgumentCaptor<Map<String, String>> map;
-
+  private ArgumentCaptor<Map<String, String>> map = ArgumentCaptor.forClass(Map.class);
   private DefaultOrganizationProvider defaultOrganizationProvider = TestDefaultOrganizationProvider.fromUuid("org1");
   private String organizationKey = defaultOrganizationProvider.get().getKey();
   private ReportSubmitter reportSubmitter = mock(ReportSubmitter.class);
   private SubmitAction underTest = new SubmitAction(reportSubmitter, defaultOrganizationProvider);
   private WsActionTester tester = new WsActionTester(underTest);
 
-  @Before
-  public void setup() {
-    MockitoAnnotations.initMocks(this);
-  }
-
   @Test
   public void submit_task_to_the_queue_and_ask_for_immediate_processing() {
     when(reportSubmitter.submit(eq(organizationKey), eq("my_project"), eq("My Project"), anyMap(), any())).thenReturn(A_CE_TASK);
index 28f385073b957669a0e4902e63725cf162a04ecf..70393d1c13bdf7f62e3da284d43b0fdffe34ecfb 100644 (file)
@@ -26,7 +26,6 @@ import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.ExpectedException;
 import org.mockito.ArgumentCaptor;
-import org.mockito.Captor;
 import org.mockito.MockitoAnnotations;
 import org.sonar.api.rule.RuleKey;
 import org.sonar.api.rule.Severity;
@@ -69,9 +68,8 @@ public class ActivateRuleActionTest {
   public UserSessionRule userSession = UserSessionRule.standalone();
   @Rule
   public ExpectedException expectedException = ExpectedException.none();
-  @Captor
-  public ArgumentCaptor<Collection<RuleActivation>> ruleActivationCaptor;
 
+  private ArgumentCaptor<Collection<RuleActivation>> ruleActivationCaptor = ArgumentCaptor.forClass(Collection.class);
   private DbClient dbClient = db.getDbClient();
   private QProfileRules qProfileRules = mock(QProfileRules.class);
   private QProfileWsSupport wsSupport = new QProfileWsSupport(dbClient, userSession, TestDefaultOrganizationProvider.from(db));
index de5d33114f5f6633c40e3b0bff1bc1b0fc92d06e..cbdcb17281245c3ada2021d311b63dcbe5d507d8 100644 (file)
@@ -26,7 +26,6 @@ import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.ExpectedException;
 import org.mockito.ArgumentCaptor;
-import org.mockito.Captor;
 import org.mockito.MockitoAnnotations;
 import org.sonar.api.rule.RuleKey;
 import org.sonar.api.server.ws.WebService;
@@ -67,9 +66,8 @@ public class DeactivateRuleActionTest {
   public UserSessionRule userSession = UserSessionRule.standalone();
   @Rule
   public ExpectedException expectedException = ExpectedException.none();
-  @Captor
-  public ArgumentCaptor<Collection<Integer>> ruleIdsCaptor;
 
+  private ArgumentCaptor<Collection<Integer>> ruleIdsCaptor = ArgumentCaptor.forClass(Collection.class);
   private DbClient dbClient = db.getDbClient();
   private QProfileRules qProfileRules = mock(QProfileRules.class);
   private QProfileWsSupport wsSupport = new QProfileWsSupport(dbClient, userSession, TestDefaultOrganizationProvider.from(db));
index 453c50776e9efb198d37d63d1203f86d9913f834..9c5f9be1702a9d06ca84103c68015fb2b6a06d3d 100644 (file)
@@ -29,14 +29,13 @@ import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.TemporaryFolder;
 import org.mockito.ArgumentCaptor;
-import org.mockito.Captor;
 import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
-import org.sonar.duplications.block.Block;
-import org.sonar.scanner.cpd.index.SonarCpdBlockIndex;
 import org.sonar.api.batch.fs.internal.DefaultInputFile;
 import org.sonar.api.batch.fs.internal.TestInputFileBuilder;
 import org.sonar.api.batch.sensor.internal.SensorContextTester;
+import org.sonar.duplications.block.Block;
+import org.sonar.scanner.cpd.index.SonarCpdBlockIndex;
 
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.ArgumentMatchers.eq;
@@ -53,9 +52,7 @@ public class JavaCpdBlockIndexerSensorTest {
   @Mock
   private SonarCpdBlockIndex index;
 
-  @Captor
-  private ArgumentCaptor<List<Block>> blockCaptor;
-
+  private ArgumentCaptor<List<Block>> blockCaptor = ArgumentCaptor.forClass(List.class);
   private DefaultInputFile file;
 
   @Before
index 13ce54c130fdbd3a2d0851443ffa42c43ad2b9dd..143278fa377a0c21921244b2f5a87372771ee278 100644 (file)
@@ -21,11 +21,8 @@ package org.sonar.scanner.scan.branch;
 
 import java.util.HashMap;
 import java.util.Map;
-import java.util.function.Supplier;
 import org.junit.Before;
 import org.junit.Test;
-import org.mockito.ArgumentCaptor;
-import org.mockito.Captor;
 import org.mockito.MockitoAnnotations;
 import org.sonar.api.batch.bootstrap.ProjectDefinition;
 import org.sonar.api.batch.bootstrap.ProjectReactor;
@@ -47,9 +44,6 @@ public class BranchConfigurationProviderTest {
   private Map<String, String> projectSettings = new HashMap<>();
   private ProjectDefinition root = mock(ProjectDefinition.class);
 
-  @Captor
-  private ArgumentCaptor<Supplier<Map<String, String>>> settingsCaptor;
-
   @Before
   public void setUp() {
     MockitoAnnotations.initMocks(this);
index 4a2fe9a4ad73e2147ab95ec6efb0e7b9285a7388..8f82987689f09f4943532b9dd9b87371c166f40f 100644 (file)
@@ -7,7 +7,7 @@ sonarqube {
 dependencies {
     compile 'junit:junit'
     compile 'org.apache.directory.server:apacheds-all:2.0.0-M24'
-    compile 'org.slf4j:slf4j-api:1.7.12'
+    compile 'org.slf4j:slf4j-api'
 
     testCompile 'org.assertj:assertj-core'
     testCompile 'org.hamcrest:hamcrest-core'