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'
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'
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;
.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);
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;
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));
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;
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));
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;
@Mock
private SonarCpdBlockIndex index;
- @Captor
- private ArgumentCaptor<List<Block>> blockCaptor;
-
+ private ArgumentCaptor<List<Block>> blockCaptor = ArgumentCaptor.forClass(List.class);
private DefaultInputFile file;
@Before
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;
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);
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'