Merge "fix NPE serviceOrder"
authorMatthieu Geerebaert <matthieu.geerebaert@orange.com>
Mon, 23 Apr 2018 14:14:55 +0000 (14:14 +0000)
committerGerrit Code Review <gerrit@onap.org>
Mon, 23 Apr 2018 14:14:55 +0000 (14:14 +0000)
1  2 
src/test/java/org/onap/nbi/apis/ApiTest.java

@@@ -180,19 -180,6 +180,19 @@@ public class ApiTest 
  
      }
  
 +    @Test
 +    public void testServiceResourceGetInventoryWithoutRelationShipList() throws Exception {
 +
 +        String serviceName = "vFW";
 +        String serviceId = "e4688e5f-61a0-4f8b-ae02-a2fbde623bcbWithoutList";
 +        MultiValueMap<String, String> params = new LinkedMultiValueMap<>();
 +        params.add("serviceSpecification.name", serviceName);
 +        params.add("relatedParty.id", "6490");
 +        ResponseEntity<Object> resource = serviceInventoryResource.getServiceInventory(serviceId, params);
 +        ServiceInventoryAssertions.assertServiceInventoryGetWithoutList(resource);
 +
 +    }
 +
  
      @Test
      public void testServiceResourceGetInventoryWithServiceSpecId() throws Exception {
  
      }
  
+     @Test
+     public void testCheckServiceOrderWithoutRelatedParty() throws Exception {
+         ServiceOrder testServiceOrder = ServiceOrderAssertions.createTestServiceOrder(ActionType.ADD);
+         testServiceOrder.setRelatedParty(null);
+         testServiceOrder.setState(StateType.ACKNOWLEDGED);
+         testServiceOrder.setId("test");
+         serviceOrderRepository.save(testServiceOrder);
+         serviceOrderResource.scheduleCheckServiceOrders();
+         ServiceOrder serviceOrderChecked = serviceOrderRepository.findOne("test");
+         assertThat(serviceOrderChecked.getState()).isEqualTo(StateType.ACKNOWLEDGED);
+     }
      @Test
      public void testCheckServiceOrderWithUnKnonwCustomer() throws Exception {