use of org.rembx.jeeshop.catalog.model.Catalog in project jeeshop by remibantos.
the class CatalogsCT method modifyCatalog_ShouldModifyCatalogAttributesAndPreserveRootCategoriesWhenNotProvided.
@Test
public void modifyCatalog_ShouldModifyCatalogAttributesAndPreserveRootCategoriesWhenNotProvided() {
tester.setStoreAdminUser();
Catalog detachedCatalogToModify = new Catalog(2L, "New name");
tester.test_modify(detachedCatalogToModify);
assertThat(detachedCatalogToModify.getName()).isEqualTo("New name");
assertThat(detachedCatalogToModify.getRootCategories()).isNotEmpty();
}
use of org.rembx.jeeshop.catalog.model.Catalog in project jeeshop by remibantos.
the class CatalogsCT method modifyNonManagedCatalog_ShouldThrowForbiddenException.
@Test
public void modifyNonManagedCatalog_ShouldThrowForbiddenException() {
tester.setSAnotherStoreAdminUser();
Catalog detachedCatalogToModify = new Catalog(1L, "name");
try {
tester.test_modify(detachedCatalogToModify);
fail("should have thrown ex");
} catch (WebApplicationException e) {
assertThat(e.getResponse().getStatusInfo()).isEqualTo(Response.Status.FORBIDDEN);
}
}
Aggregations