aboutsummaryrefslogtreecommitdiffstats
path: root/mso-api-handlers/mso-api-handler-infra/src/test
diff options
context:
space:
mode:
authorByung-Woo Jun <byung-woo.jun@est.tech>2020-09-17 05:48:03 +0000
committerGerrit Code Review <gerrit@onap.org>2020-09-17 05:48:03 +0000
commit633af62e329892feb8c7a3354a9bdb37eaef3f3d (patch)
treed4a5e082ec3b2204e9f84b80605ab8ef1539a6e9 /mso-api-handlers/mso-api-handler-infra/src/test
parent4b7611ffa47492aa6080fc58c0d04c23f32804b3 (diff)
parent30c6bacb158f5446915a772745f33a28d8da5ea2 (diff)
Merge "Implement Subnet Capability query functionality"
Diffstat (limited to 'mso-api-handlers/mso-api-handler-infra/src/test')
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/Onap3gppServiceInstancesTest.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/Onap3gppServiceInstancesTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/Onap3gppServiceInstancesTest.java
index 503af1bdcb..c3c92be013 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/Onap3gppServiceInstancesTest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/Onap3gppServiceInstancesTest.java
@@ -49,6 +49,9 @@ import org.springframework.http.ResponseEntity;
import org.springframework.web.util.UriComponentsBuilder;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
+import org.onap.so.apihandlerinfra.exceptions.ApiException;
+import org.onap.so.apihandlerinfra.onap3gppserviceinstancebeans.QuerySubnetCapability;
+import org.springframework.beans.factory.annotation.Autowired;
public class Onap3gppServiceInstancesTest extends BaseTest {
@@ -56,6 +59,9 @@ public class Onap3gppServiceInstancesTest extends BaseTest {
private final ObjectMapper mapper = new ObjectMapper();
+ @Autowired
+ private Onap3gppServiceInstances objUnderTest;
+
@Before
public void init() throws JsonProcessingException {
@@ -176,6 +182,17 @@ public class Onap3gppServiceInstancesTest extends BaseTest {
assertEquals(expectedResponse, actualResponse);
}
+ @Test
+ public void getSliceSubnetCapabilitiesTest() throws IOException, ApiException {
+ String request = "{\"subnetTypes\":[\"AN\"]}";
+ QuerySubnetCapability subnetCapabilityRequest = mapper.readValue(request, QuerySubnetCapability.class);
+ String expectedResponse =
+ "{\"AN\":{\"latency\":\"5\",\"maxNumberofUEs\":\"100\",\"maxThroughput\":\"150\",\"terminalDensity\":\"50\"}}";
+ Response response = objUnderTest.getSliceSubnetCapabilities(subnetCapabilityRequest, "v1");
+ String actualResponse = (String) response.getEntity();
+ assertEquals(Response.Status.OK.getStatusCode(), response.getStatus());
+ assertEquals(expectedResponse, actualResponse);
+ }
}