diff options
author | David Gageot <david@gageot.net> | 2015-07-07 10:45:43 +0200 |
---|---|---|
committer | David Gageot <david@gageot.net> | 2015-07-07 11:36:26 +0200 |
commit | 38df1425f5f4e967ac7f27367599c852a52b8b7c (patch) | |
tree | 3faba18cb31f6b9c77c356be775cdb10e44a6a6b | |
parent | a6f8589f7015886ba1a325ce6955d27d65da07cf (diff) | |
download | sonarqube-38df1425f5f4e967ac7f27367599c852a52b8b7c.tar.gz sonarqube-38df1425f5f4e967ac7f27367599c852a52b8b7c.zip |
Fix deprecated code
4 files changed, 9 insertions, 9 deletions
diff --git a/server/sonar-process/src/test/java/org/sonar/process/AesCipherTest.java b/server/sonar-process/src/test/java/org/sonar/process/AesCipherTest.java index fd94c291d0a..4ac2dad3ea8 100644 --- a/server/sonar-process/src/test/java/org/sonar/process/AesCipherTest.java +++ b/server/sonar-process/src/test/java/org/sonar/process/AesCipherTest.java @@ -48,7 +48,7 @@ public class AesCipherTest { String key = cipher.generateRandomSecretKey(); assertThat(StringUtils.isNotBlank(key)).isTrue(); - assertThat(Base64.isArrayByteBase64(key.getBytes())).isTrue(); + assertThat(Base64.isBase64(key.getBytes())).isTrue(); } @Test @@ -58,7 +58,7 @@ public class AesCipherTest { String encryptedText = cipher.encrypt("this is a secret"); assertThat(StringUtils.isNotBlank(encryptedText)).isTrue(); - assertThat(Base64.isArrayByteBase64(encryptedText.getBytes())).isTrue(); + assertThat(Base64.isBase64(encryptedText.getBytes())).isTrue(); } @Test diff --git a/sonar-duplications/src/test/java/org/sonar/duplications/detector/DetectorTestCase.java b/sonar-duplications/src/test/java/org/sonar/duplications/detector/DetectorTestCase.java index 100b09d1be8..261eacfe314 100644 --- a/sonar-duplications/src/test/java/org/sonar/duplications/detector/DetectorTestCase.java +++ b/sonar-duplications/src/test/java/org/sonar/duplications/detector/DetectorTestCase.java @@ -34,11 +34,11 @@ import java.util.Collections; import java.util.Iterator; import java.util.List; +import static org.hamcrest.CoreMatchers.hasItem; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.sameInstance; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertThat; -import static org.junit.matchers.JUnitMatchers.hasItem; import static org.mockito.Mockito.spy; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.verifyNoMoreInteractions; diff --git a/sonar-duplications/src/test/java/org/sonar/duplications/junit/TestNamePrinter.java b/sonar-duplications/src/test/java/org/sonar/duplications/junit/TestNamePrinter.java index 8064c822f34..4bca9becb43 100644 --- a/sonar-duplications/src/test/java/org/sonar/duplications/junit/TestNamePrinter.java +++ b/sonar-duplications/src/test/java/org/sonar/duplications/junit/TestNamePrinter.java @@ -19,14 +19,14 @@ */ package org.sonar.duplications.junit; -import org.junit.rules.TestWatchman; -import org.junit.runners.model.FrameworkMethod; +import org.junit.rules.TestWatcher; +import org.junit.runner.Description; -public class TestNamePrinter extends TestWatchman { +public class TestNamePrinter extends TestWatcher { @Override - public void starting(FrameworkMethod method) { - System.out.println("Executing " + method.getName()); + protected void starting(Description description) { + System.out.println("Executing " + description.getMethodName()); } } diff --git a/sonar-testing-harness/src/test/java/org/sonar/test/JsonAssertTest.java b/sonar-testing-harness/src/test/java/org/sonar/test/JsonAssertTest.java index 21fbee1c439..de21bc3068d 100644 --- a/sonar-testing-harness/src/test/java/org/sonar/test/JsonAssertTest.java +++ b/sonar-testing-harness/src/test/java/org/sonar/test/JsonAssertTest.java @@ -72,7 +72,7 @@ public class JsonAssertTest { @Test(expected = IllegalStateException.class) public void fail_to_load_url() throws Exception { - assertJson(new File("target/missing").toURL()); + assertJson(new File("target/missing").toURI().toURL()); } @Test |