Skip to content

Commit

Permalink
Update ProductManagementAPITest.java
Browse files Browse the repository at this point in the history
removed /shop from rest service urls
  • Loading branch information
shopizer-ecommerce committed Aug 5, 2015
1 parent e185fd4 commit c19e30f
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public void createManufacturer() throws Exception {

HttpEntity<String> entity = new HttpEntity<String>(json, getHeader());

ResponseEntity response = restTemplate.postForEntity("http://localhost:8080/sm-shop/shop/services/private/DEFAULT/manufacturer", entity, PersistableManufacturer.class);
ResponseEntity response = restTemplate.postForEntity("http://localhost:8080/sm-shop/services/private/DEFAULT/manufacturer", entity, PersistableManufacturer.class);

PersistableManufacturer manuf = (PersistableManufacturer) response.getBody();
System.out.println("New Manufacturer ID : " + manuf.getId());
Expand Down Expand Up @@ -156,7 +156,7 @@ public void createProductReview() throws Exception {

HttpEntity<String> entity = new HttpEntity<String>(json, getHeader());

ResponseEntity response = restTemplate.postForEntity("http://localhost:8080/sm-shop/shop/services/private//DEFAULT/product/review", entity, PersistableProductReview.class);
ResponseEntity response = restTemplate.postForEntity("http://localhost:8080/sm-shop/services/private//DEFAULT/product/review", entity, PersistableProductReview.class);

PersistableProductReview rev = (PersistableProductReview) response.getBody();
System.out.println("New ProductReview ID : " + rev.getId());
Expand Down Expand Up @@ -214,7 +214,7 @@ public void createOptionValue() throws Exception {

HttpEntity<String> entity = new HttpEntity<String>(json, getHeader());

ResponseEntity response = restTemplate.postForEntity("http://localhost:8080/sm-shop/shop/services/private/DEFAULT/product/optionValue", entity, PersistableProductOptionValue.class);
ResponseEntity response = restTemplate.postForEntity("http://localhost:8080/sm-shop/services/private/DEFAULT/product/optionValue", entity, PersistableProductOptionValue.class);

PersistableProductOptionValue opt = (PersistableProductOptionValue) response.getBody();
System.out.println("New optionValue ID : " + opt.getId());
Expand Down Expand Up @@ -272,7 +272,7 @@ public void createOption() throws Exception {

HttpEntity<String> entity = new HttpEntity<String>(json, getHeader());

ResponseEntity response = restTemplate.postForEntity("http://localhost:8080/sm-shop/shop/services/private/DEFAULT/product/option", entity, PersistableProductOption.class);
ResponseEntity response = restTemplate.postForEntity("http://localhost:8080/sm-shop/services/private/DEFAULT/product/option", entity, PersistableProductOption.class);

PersistableProductOption opt = (PersistableProductOption) response.getBody();
System.out.println("New option ID : " + opt.getId());
Expand All @@ -287,7 +287,7 @@ public void getProducts() throws Exception {

HttpEntity<String> httpEntity = new HttpEntity<String>(getHeader());

ResponseEntity<ReadableProduct[]> response = restTemplate.exchange("http://localhost:8080/sm-shop/shop/services/rest/products/DEFAULT/en/"+testCategoryID, HttpMethod.GET, httpEntity, ReadableProduct[].class);
ResponseEntity<ReadableProduct[]> response = restTemplate.exchange("http://localhost:8080/sm-shop/services/rest/products/DEFAULT/en/"+testCategoryID, HttpMethod.GET, httpEntity, ReadableProduct[].class);

if(response.getStatusCode() != HttpStatus.OK){
throw new Exception();
Expand Down Expand Up @@ -440,7 +440,7 @@ public void deleteProduct() throws Exception {

HttpEntity<String> httpEntity = new HttpEntity<String>(getHeader());

restTemplate.exchange("http://localhost:8080/sm-shop/shop/services/rest/products/DEFAULT/en/"+testCategoryID+"/"+testProductID, HttpMethod.DELETE, httpEntity, ReadableProduct.class);
restTemplate.exchange("http://localhost:8080/sm-shop/services/rest/products/DEFAULT/en/"+testCategoryID+"/"+testProductID, HttpMethod.DELETE, httpEntity, ReadableProduct.class);
System.out.println("Product "+testProductID+" Deleted.");
}

Expand Down

0 comments on commit c19e30f

Please sign in to comment.