@Test public void testSetAndGetFilter() { assertThat(category.getFilter()).isNull(); category.setFilter(new StartsWith()); assertThat(category.getFilter()).isEqualTo(new StartsWith()); category.setFilter(null); assertThat(category.getFilter()).isNull(); }
@Test public void testEquals() { assertThat(category).isEqualTo(new ForeNameCategory()); assertThat(category).isEqualTo(category); assertThat(category).isNotEqualTo(null); assertThat(category).isNotEqualTo(new LocationCategory()); assertThat(category).isNotEqualTo("category"); category.setFilter(new StringEquals()); final ForeNameCategory other = new ForeNameCategory(); assertThat(category).isNotEqualTo(other); assertThat(other).isNotEqualTo(category); other.setFilter(new StringEquals()); assertThat(category).isEqualTo(other); final LocationCategory different = new LocationCategory(); different.setFilter(new StringEquals()); category.getFilter().setFilterValue("juppi <- :)"); assertThat(category).isNotEqualTo(different); assertThat(different).isNotEqualTo(category); }