use of org.rembx.jeeshop.catalog.model.Store in project jeeshop by remibantos.
the class StoresCT method modify_shouldModify_for_store_admin.
@Test
public void modify_shouldModify_for_store_admin() {
tester.setStoreAdminUser();
Store store = new Store(1L, "Superstore 2");
store.setOwner(TestCatalog.OWNER);
tester.test_modify(store);
Store actual = tester.getEntityManager().find(Store.class, store.getId());
assertThat(actual).isNotNull();
assertThat(actual.getName()).isEqualTo("Superstore 2");
}
use of org.rembx.jeeshop.catalog.model.Store in project jeeshop by remibantos.
the class StoresCT method delete_shouldThrowForbidden_for_store_admin.
@Test
public void delete_shouldThrowForbidden_for_store_admin() {
try {
tester.setStoreAdminUser();
Store store = new Store("Superstore");
store.setOwner("test@test.org");
tester.test_delete(store);
fail("Should have throw an exception");
} catch (WebApplicationException e) {
assertThat(e.getResponse().getStatusInfo()).isEqualTo(Response.Status.FORBIDDEN);
}
}
use of org.rembx.jeeshop.catalog.model.Store in project jeeshop by remibantos.
the class StoresCT method find_shouldLoadNonVisibleItem_for_admin.
@Test
public void find_shouldLoadNonVisibleItem_for_admin() {
tester.setAdminUser();
Store store = localService.find(tester.getSecurityContext(), 1L, null);
assertThat(store).isNotNull();
}
Aggregations