summaryrefslogtreecommitdiffstats
path: root/src/test/java
diff options
context:
space:
mode:
authorromaingimbert <romain.gimbert@orange.com>2018-05-16 14:42:36 +0200
committerromaingimbert <romain.gimbert@orange.com>2018-05-16 14:42:36 +0200
commit9d0bf45a33f37c7644a15d12e0c6eefa5124fd6c (patch)
tree07b0a279391d191d67ea265e6b1b862884464f8c /src/test/java
parent12875d9ac2e33ba4edbdee4f840813611786508c (diff)
infinite loop when so not responding
- fix code - add test Change-Id: Idcf9383d38e821418c16e8f72250df238e1a6b78 Issue-ID: EXTAPI-89 Signed-off-by: romaingimbert <romain.gimbert@orange.com>
Diffstat (limited to 'src/test/java')
-rw-r--r--src/test/java/org/onap/nbi/apis/ApiTest.java34
1 files changed, 26 insertions, 8 deletions
diff --git a/src/test/java/org/onap/nbi/apis/ApiTest.java b/src/test/java/org/onap/nbi/apis/ApiTest.java
index ef285a4..a650ab5 100644
--- a/src/test/java/org/onap/nbi/apis/ApiTest.java
+++ b/src/test/java/org/onap/nbi/apis/ApiTest.java
@@ -622,8 +622,8 @@ public class ApiTest {
}
- executionTaskB = getExecutionTask("B");
- assertThat(executionTaskB).isNull();
+ assertThat(executionTaskRepository.count()).isEqualTo(0);
+
}
@@ -661,8 +661,8 @@ public class ApiTest {
}
- executionTaskB = getExecutionTask("B");
- assertThat(executionTaskB).isNull();
+ assertThat(executionTaskRepository.count()).isEqualTo(0);
+
}
@@ -702,8 +702,7 @@ public class ApiTest {
}
- ExecutionTask executionTaskB = executionTaskRepository.findOne(Long.parseLong("2"));
- assertThat(executionTaskB).isNull();
+ assertThat(executionTaskRepository.count()).isEqualTo(0);
}
@@ -727,11 +726,30 @@ public class ApiTest {
assertThat(serviceOrderItem.getState()).isEqualTo(StateType.FAILED);
}
- ExecutionTask executionTaskB = executionTaskRepository.findOne(Long.parseLong("2"));
- assertThat(executionTaskB).isNull();
+ assertThat(executionTaskRepository.count()).isEqualTo(0);
+
}
+ @Test
+ public void testExecutionTaskFailedNoSoAndStatusResponse() throws Exception {
+
+ ExecutionTask executionTaskA = ServiceOrderAssertions.setUpBddForExecutionTaskSucess(serviceOrderRepository,
+ executionTaskRepository, ActionType.ADD);
+
+ removeWireMockMapping("/ecomp/mso/infra/serviceInstances/v4");
+ removeWireMockMapping("/ecomp/mso/infra/orchestrationRequests/v4/requestId");
+
+ SoTaskProcessor.processOrderItem(executionTaskA);
+ ServiceOrder serviceOrderChecked = serviceOrderRepository.findOne("test");
+ assertThat(serviceOrderChecked.getState()).isEqualTo(StateType.FAILED);
+ for (ServiceOrderItem serviceOrderItem : serviceOrderChecked.getOrderItem()) {
+ assertThat(serviceOrderItem.getState()).isEqualTo(StateType.FAILED);
+ }
+
+ assertThat(executionTaskRepository.count()).isEqualTo(0);
+
+ }
}