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 {
Object check = factory.getCheck(activeRule);
assertNotNull(check);
- assertThat(check, is(CheckWithoutProperties.class));
+ assertThat(check).isInstanceOf(CheckWithoutProperties.class);
}
@Test
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
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
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);
}
/**
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
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
Object check = factory.getCheck(activeRule);
assertNotNull(check);
assertSame(check, checkInstance);
- assertThat(checkInstance.getPattern(), is("foo"));
+ assertThat(checkInstance.getPattern()).isEqualTo("foo");
}
}