summaryrefslogtreecommitdiffstats
path: root/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc
diff options
context:
space:
mode:
Diffstat (limited to 'bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc')
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/SDNCClientIT.java (renamed from bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/SDNCClientTest.java)17
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/GCTopologyOperationRequestMapperTest.java13
2 files changed, 15 insertions, 15 deletions
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/SDNCClientTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/SDNCClientIT.java
index 66ec514039..cc1c5c5329 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/SDNCClientTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/SDNCClientIT.java
@@ -23,37 +23,30 @@ package org.onap.so.client.sdnc;
import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
import static com.github.tomakehurst.wiremock.client.WireMock.get;
import static com.github.tomakehurst.wiremock.client.WireMock.post;
+import static com.github.tomakehurst.wiremock.client.WireMock.stubFor;
import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching;
-import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
-import org.junit.Rule;
import org.junit.Test;
import org.onap.so.BaseIntegrationTest;
-import org.onap.so.bpmn.BaseTaskTest;
import org.onap.so.client.exception.BadResponseException;
import org.onap.so.client.exception.MapperException;
import org.onap.so.client.sdnc.endpoint.SDNCTopology;
import org.skyscreamer.jsonassert.JSONAssert;
-import com.github.tomakehurst.wiremock.junit.WireMockRule;
-
-public class SDNCClientTest extends BaseIntegrationTest {
+public class SDNCClientIT extends BaseIntegrationTest {
private final static String JSON_FILE_LOCATION = "src/test/resources/__files/";
- @Rule
- public WireMockRule wireMockRule = new WireMockRule(wireMockConfig().port(8446));
-
@Test
public void getTest() throws BadResponseException, MapperException, IOException {
String responseJson = new String(Files.readAllBytes(Paths.get(JSON_FILE_LOCATION + "SDNCClientGetResponse.json")));
String queryLink = "/topologyQuery";
- wireMockRule.stubFor(get(urlEqualTo(queryLink))
+ stubFor(get(urlEqualTo(queryLink))
.willReturn(aResponse().withStatus(200)
.withHeader("Content-Type", "application/json").withBody(responseJson)));
String response = SPY_sdncClient.get(queryLink);
@@ -66,7 +59,7 @@ public class SDNCClientTest extends BaseIntegrationTest {
String queryLink = "/restconf/operations/GENERIC-RESOURCE-API:network-topology-operation/";
- wireMockRule.stubFor(post(urlMatching(queryLink))
+ stubFor(post(urlMatching(queryLink))
.willReturn(aResponse().withStatus(200)
.withHeader("Content-Type", "application/json").withBody(responseJson)));
@@ -79,7 +72,7 @@ public class SDNCClientTest extends BaseIntegrationTest {
String queryLink = "/restconf/operations/GENERIC-RESOURCE-API:network-topology-operation/";
- wireMockRule.stubFor(post(urlMatching(queryLink))
+ stubFor(post(urlMatching(queryLink))
.willReturn(aResponse().withStatus(200)
.withHeader("Content-Type", "application/json").withBody(responseJson)));
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/GCTopologyOperationRequestMapperTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/GCTopologyOperationRequestMapperTest.java
index 7c5e9ccf26..f01eeaeae8 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/GCTopologyOperationRequestMapperTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/GCTopologyOperationRequestMapperTest.java
@@ -20,6 +20,8 @@
package org.onap.so.client.sdnc.mapper;
+import java.net.URI;
+import java.net.URISyntaxException;
import java.util.HashMap;
import java.util.List;
@@ -44,7 +46,7 @@ public class GCTopologyOperationRequestMapperTest extends TestDataSetup{
private GCTopologyOperationRequestMapper genObjMapper = new GCTopologyOperationRequestMapper();
@Test
- public void deactivateOrUnassignVnrReqMapperTest() {
+ public void deactivateOrUnassignVnrReqMapperTest() throws URISyntaxException {
RequestContext requestContext = new RequestContext();
requestContext.setMsoRequestId("MsoRequestId");
ServiceInstance serviceInstance = new ServiceInstance();
@@ -52,10 +54,15 @@ public class GCTopologyOperationRequestMapperTest extends TestDataSetup{
Configuration Configuration = new Configuration();
Configuration.setConfigurationId("ConfigurationId");
GenericResourceApiGcTopologyOperationInformation genericInfo = genObjMapper.deactivateOrUnassignVnrReqMapper
- (SDNCSvcAction.UNASSIGN, serviceInstance, requestContext, Configuration);
+ (SDNCSvcAction.UNASSIGN, serviceInstance, requestContext, Configuration,"uuid",new URI("http://localhost"));
Assert.assertNotNull(genericInfo);
- Assert.assertNotNull(genericInfo.getSdncRequestHeader().getSvcRequestId());
+ Assert.assertNotNull(genericInfo.getRequestInformation());
+ Assert.assertNotNull(genericInfo.getSdncRequestHeader());
+ Assert.assertNotNull(genericInfo.getClass());
+ Assert.assertNotNull(genericInfo.getServiceInformation());
+ Assert.assertEquals("uuid",genericInfo.getSdncRequestHeader().getSvcRequestId());
+ Assert.assertEquals("http://localhost",genericInfo.getSdncRequestHeader().getSvcNotificationUrl());
}