use of com.salesmanager.shop.model.store.PersistableMerchantStore in project shopizer by shopizer-ecommerce.
the class MerchantStoreApiIntegrationTest method testCreateStore.
/**
* Create a new store then delete it
* @throws Exception
*/
@Test
public void testCreateStore() throws Exception {
PersistableAddress address = new PersistableAddress();
address.setAddress("121212 simple address");
address.setPostalCode("12345");
address.setCountry("US");
address.setCity("FT LD");
address.setStateProvince("FL");
PersistableMerchantStore createdStore = new PersistableMerchantStore();
createdStore.setCode(TEST_STORE_CODE);
createdStore.setCurrency(CURRENCY);
createdStore.setDefaultLanguage(DEFAULT_LANGUAGE);
createdStore.setEmail("test@test.com");
createdStore.setName(TEST_STORE_CODE);
createdStore.setPhone("444-555-6666");
createdStore.setSupportedLanguages(Arrays.asList(DEFAULT_LANGUAGE));
createdStore.setAddress(address);
final HttpEntity<PersistableMerchantStore> httpEntity = new HttpEntity<PersistableMerchantStore>(createdStore, getHeader());
ResponseEntity<Void> response = testRestTemplate.exchange(String.format("/api/v1/private/store/"), HttpMethod.POST, httpEntity, Void.class);
assertThat(response.getStatusCode(), is(HttpStatus.OK));
}
Aggregations