diff options
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.java | 17 |
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); + } } |