use of com.nixmash.blog.jpa.dto.CategoryDTO in project nixmash-blog by mintster.
the class PostServiceTests method setDefaultCategoryResultsInSingleDefault.
@Test
public void setDefaultCategoryResultsInSingleDefault() throws Exception {
// H2Data Status: Java Category is Sole Default
Category category = postService.getCategory("wannabe");
assertEquals(category.getIsDefault(), false);
assertEquals(defaultCategoryCount(), 1);
// Sole Default will be Wannabe Category
Category updated = postService.updateCategory(new CategoryDTO(5L, "Wannabe", 0, true, true));
assertEquals(category.getIsDefault(), true);
assertEquals(defaultCategoryCount(), 1);
}
Aggregations