]> source.dussan.org Git - sonarqube.git/commitdiff
Fix unit test compilation failure
authorJulien Lancelot <julien.lancelot@sonarsource.com>
Thu, 12 Jun 2014 10:22:16 +0000 (12:22 +0200)
committerJulien Lancelot <julien.lancelot@sonarsource.com>
Thu, 12 Jun 2014 10:22:16 +0000 (12:22 +0200)
sonar-deprecated/src/test/java/org/sonar/api/checks/AnnotationCheckFactoryTest.java

index eb4ac6354aea47adcc0b2ca47fce0b721adf99fb..d0a14fd17eac6b8666c370e2273c27f471eeeb30 100644 (file)
@@ -29,8 +29,8 @@ import org.sonar.api.utils.SonarException;
 import java.util.Arrays;
 
 import static org.fest.assertions.Assertions.assertThat;
-import static org.hamcrest.core.Is.is;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertSame;
 
 public class AnnotationCheckFactoryTest {
 
@@ -45,7 +45,7 @@ public class AnnotationCheckFactoryTest {
 
     Object check = factory.getCheck(activeRule);
     assertNotNull(check);
-    assertThat(check, is(CheckWithoutProperties.class));
+    assertThat(check).isInstanceOf(CheckWithoutProperties.class);
   }
 
   @Test
@@ -60,8 +60,8 @@ public class AnnotationCheckFactoryTest {
 
     Object check = factory.getCheck(activeRule);
     assertNotNull(check);
-    assertThat(check, is(CheckWithStringProperty.class));
-    assertThat(((CheckWithStringProperty) check).getPattern(), is("foo"));
+    assertThat(check).isInstanceOf(CheckWithStringProperty.class);
+    assertThat(((CheckWithStringProperty) check).getPattern()).isEqualTo("foo");
   }
 
   @Test
@@ -90,8 +90,8 @@ public class AnnotationCheckFactoryTest {
     AnnotationCheckFactory factory = AnnotationCheckFactory.create(profile, "repo", Arrays.<Class> asList(CheckWithPrimitiveProperties.class));
 
     Object check = factory.getCheck(activeRule);
-    assertThat(((CheckWithPrimitiveProperties) check).getMax(), is(300));
-    assertThat(((CheckWithPrimitiveProperties) check).isIgnore(), is(true));
+    assertThat(((CheckWithPrimitiveProperties) check).getMax()).isEqualTo(300);
+    assertThat(((CheckWithPrimitiveProperties) check).isIgnore()).isTrue();
   }
 
   @Test
@@ -105,7 +105,7 @@ public class AnnotationCheckFactoryTest {
     AnnotationCheckFactory factory = AnnotationCheckFactory.create(profile, "repo", Arrays.<Class> asList(CheckWithIntegerProperty.class));
 
     Object check = factory.getCheck(activeRule);
-    assertThat(((CheckWithIntegerProperty) check).getMax(), is(300));
+    assertThat(((CheckWithIntegerProperty) check).getMax()).isEqualTo(300);
   }
 
   /**
@@ -122,7 +122,7 @@ public class AnnotationCheckFactoryTest {
     AnnotationCheckFactory factory = AnnotationCheckFactory.create(profile, "repo", Arrays.<Class> asList(ImplementedCheck.class));
 
     Object check = factory.getCheck(activeRule);
-    assertThat(((ImplementedCheck) check).getMax(), is(300));
+    assertThat(((ImplementedCheck) check).getMax()).isEqualTo(300);
   }
 
   @Test
@@ -149,7 +149,7 @@ public class AnnotationCheckFactoryTest {
     AnnotationCheckFactory factory = AnnotationCheckFactory.create(profile, "repo", Arrays.<Class> asList(CheckWithOverriddenPropertyKey.class));
 
     Object check = factory.getCheck(activeRule);
-    assertThat(((CheckWithOverriddenPropertyKey) check).getMax(), is(300));
+    assertThat(((CheckWithOverriddenPropertyKey) check).getMax()).isEqualTo(300);
   }
 
   @Test
@@ -194,6 +194,6 @@ public class AnnotationCheckFactoryTest {
     Object check = factory.getCheck(activeRule);
     assertNotNull(check);
     assertSame(check, checkInstance);
-    assertThat(checkInstance.getPattern(), is("foo"));
+    assertThat(checkInstance.getPattern()).isEqualTo("foo");
   }
 }