aboutsummaryrefslogtreecommitdiffstats
path: root/vnfmarket-be/vnf-sdk-marketplace/src/test/java/org/onap/vtp/VTPExecutionResourceTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'vnfmarket-be/vnf-sdk-marketplace/src/test/java/org/onap/vtp/VTPExecutionResourceTest.java')
-rw-r--r--vnfmarket-be/vnf-sdk-marketplace/src/test/java/org/onap/vtp/VTPExecutionResourceTest.java44
1 files changed, 5 insertions, 39 deletions
diff --git a/vnfmarket-be/vnf-sdk-marketplace/src/test/java/org/onap/vtp/VTPExecutionResourceTest.java b/vnfmarket-be/vnf-sdk-marketplace/src/test/java/org/onap/vtp/VTPExecutionResourceTest.java
index 0c6ddd61..cec0a6c4 100644
--- a/vnfmarket-be/vnf-sdk-marketplace/src/test/java/org/onap/vtp/VTPExecutionResourceTest.java
+++ b/vnfmarket-be/vnf-sdk-marketplace/src/test/java/org/onap/vtp/VTPExecutionResourceTest.java
@@ -370,50 +370,16 @@ public class VTPExecutionResourceTest {
// given
String testStartTime = "2020-08-10T08:50:20.845";
String testEndTime = "2020-08-11T08:51:50.845";
- String testRequestId = "test-03-request-id";
String testProduct = "VTP Scenario 3";
String testCommand = "s1.ts1.testcase-3";
String testSuiteName = "testsuite-3";
+ String testRequestId = "test-03-request-id";
String testProfile = "open-cli-schema";
- new MockUp<DistManager>(){
- @mockit.Mock
- protected JsonElement getExecutionJson(int count, int index) {
- String values = "[{\"tester_id\":\"1\", \"end-time\":\"end-time\", " +
- "\"id\":\"2\", \"product\":\"product\"," +
- "\"service\":\"service\", \"command\":\"command\", " +
- "\"profile\":\"profile\", \"status\":\"status\", \"execution_id\":\"test-01-request-id-execution-id\"}]";
- JsonParser jsonParser = new JsonParser();
- return jsonParser.parse(values);
- }
- };
- new MockUp<DistManager>(){
- @mockit.Mock
- protected JsonElement getResponseFromTester(Client client, String managerURL, String testerPath) {
- String values = "{\"tester_id\":\"1\", \"end-time\":\"end-time\", " +
- "\"iP\":\"localhost\", \"port\":\"55130\"," +
- "\"service\":\"service\", \"command\":\"command\", " +
- "\"profile\":\"profile\", \"status\":\"status\", \"execution-id\":\"123456\"}";
- JsonParser jsonParser = new JsonParser();
- return jsonParser.parse(values);
- }
- };
-
- new MockUp<OpenRemoteCli>(){
- @mockit.Mock
- protected Result run(String vtpTestCenterIp, int vtpTestCenterPort, List<String> args, int timeout) throws OpenInterfaceGrpcTimeoutExecption {
- throw new OpenInterfaceGrpcClient.OpenInterfaceGrpcTimeoutExecption("Timed Out");
- }
- };
-
- /*
- * // when exceptionRule.expect(VTPError.VTPException.class); exceptionRule.
- * expectMessage("Timed out. Please use request-id to track the progress.");
- */
- VTPTestExecutionList list = vtpExecutionResource.listTestExecutionsHandler(
- testRequestId, testProduct, testSuiteName, testCommand, testProfile, testStartTime, testEndTime,1,0
- );
- assertEquals(0, list.getExecutions().size());// during exception the list size is empty
+ exceptionRule.expect(VTPError.VTPException.class);
+ exceptionRule.expectMessage("Timed out. Please use request-id to track the progress.");
+ vtpExecutionResource.listTestExecutionsHandler(
+ testRequestId, testProduct, testSuiteName, testCommand, testProfile, testStartTime, testEndTime, 1, 0);
}