use of org.rembx.jeeshop.catalog.model.Category in project jeeshop by remibantos.
the class CategoriesCT method find_withIdOfVisibleCategory_ShouldReturnExpectedCategory.
@Test
public void find_withIdOfVisibleCategory_ShouldReturnExpectedCategory() {
tester.setAdminUser();
Category category = localService.find(tester.getSecurityContext(), tester.getFixtures().aCategoryWithProducts().getId(), null);
assertThat(category).isEqualTo(tester.getFixtures().aCategoryWithProducts());
assertThat(category.isVisible()).isTrue();
}
use of org.rembx.jeeshop.catalog.model.Category in project jeeshop by remibantos.
the class CategoriesCT method delete_NonManagedEntry_shouldThrowForbiddenEx.
@Test
public void delete_NonManagedEntry_shouldThrowForbiddenEx() {
try {
tester.setStoreAdminUser();
Category category = new Category("Test category", "");
category.setOwner("test@test.com");
tester.test_delete(category);
fail("should have thrown ex");
} catch (WebApplicationException e) {
assertThat(e.getResponse().getStatusInfo()).isEqualTo(Response.Status.FORBIDDEN);
}
}
Aggregations