use of org.rembx.jeeshop.catalog.model.Store in project jeeshop by remibantos.
the class StoresCT method create_shouldSetupOwner_for_store_admin.
@Test
public void create_shouldSetupOwner_for_store_admin() {
tester.setStoreAdminUser();
Store store = new Store("Superstore");
Store actualStore = tester.test_create(store);
assertThat(actualStore).isNotNull();
assertThat(actualStore.getOwner()).isEqualTo(TestCatalog.OWNER);
}
use of org.rembx.jeeshop.catalog.model.Store in project jeeshop by remibantos.
the class StoresCT method create_shouldThrowBadRequest_whenOwnerIsNull_for_admin.
@Test
public void create_shouldThrowBadRequest_whenOwnerIsNull_for_admin() {
tester.setAdminUser();
Store store = new Store("Superstore");
try {
tester.test_create(store);
fail("should have thrown an exception");
} catch (WebApplicationException e) {
assertThat(e.getResponse().getStatusInfo()).isEqualTo(Response.Status.BAD_REQUEST);
}
}
use of org.rembx.jeeshop.catalog.model.Store in project jeeshop by remibantos.
the class StoresCT method delete_shouldRemove_for_admin.
@Test
public void delete_shouldRemove_for_admin() {
tester.setAdminUser();
Store store = new Store("Superstore");
store.setOwner(TestCatalog.OWNER);
tester.test_delete(store);
assertThat(tester.getEntityManager().find(Store.class, store.getId())).isNull();
}
use of org.rembx.jeeshop.catalog.model.Store in project jeeshop by remibantos.
the class StoresCT method find_shouldLoadNonVisibleItem_for_store_admin.
@Test
public void find_shouldLoadNonVisibleItem_for_store_admin() {
tester.setStoreAdminUser();
Store store = localService.find(tester.getSecurityContext(), 1L, null);
assertThat(store).isNotNull();
}
use of org.rembx.jeeshop.catalog.model.Store in project jeeshop by remibantos.
the class StoresCT method modify_shouldThrowNotFound_for_store_admin.
@Test
public void modify_shouldThrowNotFound_for_store_admin() {
try {
tester.setStoreAdminUser();
Store store = new Store(666L, "Superstore");
tester.test_modify(store);
fail("Should have throw an exception");
} catch (WebApplicationException e) {
assertThat(e.getResponse().getStatusInfo()).isEqualTo(Response.Status.NOT_FOUND);
}
}
Aggregations