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)
src/test/java/org/onap/nbi/apis/ApiTest.java

index 563760e..937f417 100644 (file)
@@ -289,6 +289,24 @@ public class ApiTest {
 
     }
 
+
+    @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 {