aboutsummaryrefslogtreecommitdiffstats
path: root/vnfmarket-be/vnf-sdk-marketplace/src/test/java/org/onap
diff options
context:
space:
mode:
Diffstat (limited to 'vnfmarket-be/vnf-sdk-marketplace/src/test/java/org/onap')
-rw-r--r--vnfmarket-be/vnf-sdk-marketplace/src/test/java/org/onap/vtp/VTPExecutionResourceTest.java44
-rw-r--r--vnfmarket-be/vnf-sdk-marketplace/src/test/java/org/onap/vtp/execution/VTPExecutionResourceTest.java31
2 files changed, 6 insertions, 69 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);
}
diff --git a/vnfmarket-be/vnf-sdk-marketplace/src/test/java/org/onap/vtp/execution/VTPExecutionResourceTest.java b/vnfmarket-be/vnf-sdk-marketplace/src/test/java/org/onap/vtp/execution/VTPExecutionResourceTest.java
index e558a6bb..6d6afd5d 100644
--- a/vnfmarket-be/vnf-sdk-marketplace/src/test/java/org/onap/vtp/execution/VTPExecutionResourceTest.java
+++ b/vnfmarket-be/vnf-sdk-marketplace/src/test/java/org/onap/vtp/execution/VTPExecutionResourceTest.java
@@ -296,39 +296,10 @@ public class VTPExecutionResourceTest {
return result;
}
};
- new MockUp<VTPResource>(){
- @mockit.Mock
- protected Result makeRpc(List<String> args,int count,int index) throws VTPError.VTPException {
- Result result = Result.newBuilder().build();
- return result;
- }
- };
- new MockUp<VTPResource>(){
- @mockit.Mock
- protected JsonElement makeRpcAndGetJson(List<String> args,int count,int index, int timeout) throws VTPError.VTPException {
- String values = "[{\"start-time\":\"start-time\", \"end-time\":\"end-time\", " +
- "\"request-id\":\"request-id\", \"product\":\"product\"," +
- "\"service\":\"service\", \"command\":\"command\", " +
- "\"profile\":\"profile\", \"status\":\"status\", \"execution-id\":\"execution-id\"}]";
- JsonParser jsonParser = new JsonParser();
- return jsonParser.parse(values);
- }
- };
- new MockUp<VTPResource>(){
- @mockit.Mock
- protected JsonElement makeRpcAndGetJson(List<String> args,int count,int index) throws VTPError.VTPException {
- String values = "[{\"start-time\":\"start-time\", \"end-time\":\"end-time\", " +
- "\"request-id\":\"request-id\", \"product\":\"product\"," +
- "\"service\":\"service\", \"command\":\"command\", " +
- "\"profile\":\"profile\", \"status\":\"status\", \"execution-id\":\"execution-id\"}]";
- JsonParser jsonParser = new JsonParser();
- return jsonParser.parse(values);
- }
- };
new MockUp<Result>(){
@mockit.Mock
public String getOutput() {
- return "{\"product\":\"tutorial\"}";
+ return "[{\"product\":\"tutorial\"}]";
}
};
VTPTestExecution.VTPTestExecutionList vtpTestExecutionList = vtpExecutionResource1.listTestExecutionsHandler(requestId,"tutorial","ut","list-users","abc","123","123",1,0);