diff options
4 files changed, 7 insertions, 8 deletions
diff --git a/sonar-duplications/src/test/java/org/sonar/duplications/detector/CloneGroupMatcher.java b/sonar-duplications/src/test/java/org/sonar/duplications/detector/CloneGroupMatcher.java index a93fcab72f7..ec26aae92fa 100644 --- a/sonar-duplications/src/test/java/org/sonar/duplications/detector/CloneGroupMatcher.java +++ b/sonar-duplications/src/test/java/org/sonar/duplications/detector/CloneGroupMatcher.java @@ -19,17 +19,18 @@ */ package org.sonar.duplications.detector; -import org.hamcrest.CoreMatchers; import org.hamcrest.Description; import org.hamcrest.Matcher; import org.hamcrest.TypeSafeMatcher; import org.sonar.duplications.index.CloneGroup; import org.sonar.duplications.index.ClonePart; +import static org.hamcrest.Matchers.hasItem; + public class CloneGroupMatcher extends TypeSafeMatcher<CloneGroup> { public static Matcher<Iterable<? super CloneGroup>> hasCloneGroup(int expectedLen, ClonePart... expectedParts) { - return CoreMatchers.hasItem(new CloneGroupMatcher(expectedLen, expectedParts)); + return hasItem(new CloneGroupMatcher(expectedLen, expectedParts)); } private final int expectedLen; diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/batch/bootstrap/ProjectDefinitionTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/batch/bootstrap/ProjectDefinitionTest.java index ea63a12f5f9..b9265129605 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/batch/bootstrap/ProjectDefinitionTest.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/batch/bootstrap/ProjectDefinitionTest.java @@ -27,7 +27,6 @@ import java.io.File; import java.util.List; import java.util.Properties; -import org.hamcrest.CoreMatchers; import org.junit.Test; import org.sonar.api.CoreProperties; @@ -137,8 +136,8 @@ public class ProjectDefinitionTest { def.addBinaryDir(new File("target/classes")); assertThat(def.getSourceDirs().size(), is(2)); - assertThat(def.getTestDirs().size(), CoreMatchers.is(2)); - assertThat(def.getBinaries().size(), CoreMatchers.is(1)); + assertThat(def.getTestDirs().size(), is(2)); + assertThat(def.getBinaries().size(), is(1)); } @Test diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/utils/FieldUtils2Test.java b/sonar-plugin-api/src/test/java/org/sonar/api/utils/FieldUtils2Test.java index 1a18c2e77b6..c41f6856076 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/utils/FieldUtils2Test.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/utils/FieldUtils2Test.java @@ -26,8 +26,8 @@ import org.junit.Test; import java.lang.reflect.Field; import java.util.List; +import static org.hamcrest.Matchers.hasItem; import static org.junit.Assert.assertThat; -import static org.junit.matchers.JUnitMatchers.hasItem; public class FieldUtils2Test { diff --git a/sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/ProfileUnmarshallerTest.java b/sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/ProfileUnmarshallerTest.java index 2037a5295b4..15ef01d1e24 100644 --- a/sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/ProfileUnmarshallerTest.java +++ b/sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/ProfileUnmarshallerTest.java @@ -19,7 +19,6 @@ */ package org.sonar.wsclient.unmarshallers; -import org.hamcrest.CoreMatchers; import org.junit.Test; import org.sonar.wsclient.services.Profile; @@ -47,7 +46,7 @@ public class ProfileUnmarshallerTest extends UnmarshallerTestCase { Profile.Rule rule1 = profile.getRules().get(0); assertThat(rule1.getKey(), is("com.puppycrawl.tools.checkstyle.checks.coding.InnerAssignmentCheck")); assertThat(rule1.getRepository(), is("checkstyle")); - assertThat(rule1.getInheritance(), CoreMatchers.<Object>nullValue()); + assertThat(rule1.getInheritance(), nullValue()); assertThat(rule1.getSeverity(), is("MAJOR")); assertThat(rule1.getParameters().size(), is(0)); assertThat(rule1.getParameter("foo"), nullValue()); |