diff options
author | Dilip kumar Pampana <dilip.kumar.pampana@ibm.com> | 2018-07-15 01:49:23 -0400 |
---|---|---|
committer | Patrick Brady <pb071s@att.com> | 2018-07-16 18:56:32 +0000 |
commit | 8379e2a201b65bfe911bc3887ffe6e604196302b (patch) | |
tree | 801e3a8719f2003d3586ff02a0dfc8be37a25cda /appc-inbound/appc-interfaces-service | |
parent | c9fd7e566a5ed23541d1e7a59388961f91cc370a (diff) |
Junits for Interface-services
Junit test for vf-module-id to check for scope overlap
Issue-ID: APPC-1079
Change-Id: I7345e709809f46df3532d8d8608ce5d53d04ed11
Signed-off-by: Dilip kumar Pampana <dilip.kumar.pampana@ibm.com>
Diffstat (limited to 'appc-inbound/appc-interfaces-service')
-rw-r--r-- | appc-inbound/appc-interfaces-service/bundle/src/test/java/org/onap/appc/interfaceService/serviceExecutor/TestServiceExecutor.java | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/appc-inbound/appc-interfaces-service/bundle/src/test/java/org/onap/appc/interfaceService/serviceExecutor/TestServiceExecutor.java b/appc-inbound/appc-interfaces-service/bundle/src/test/java/org/onap/appc/interfaceService/serviceExecutor/TestServiceExecutor.java index e5bf0c0cd..4a8889022 100644 --- a/appc-inbound/appc-interfaces-service/bundle/src/test/java/org/onap/appc/interfaceService/serviceExecutor/TestServiceExecutor.java +++ b/appc-inbound/appc-interfaces-service/bundle/src/test/java/org/onap/appc/interfaceService/serviceExecutor/TestServiceExecutor.java @@ -5,6 +5,8 @@ * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Copyright (C) 2017 Amdocs + * ================================================================================ + * Copyright (C) 2018 IBM * ============================================================================= * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,6 +30,10 @@ import static org.junit.Assert.*; import org.junit.Test; import org.onap.appc.interfaces.service.executorImpl.ServiceExecutorImpl; +import org.onap.appc.interfaces.service.data.ScopeOverlap; +import com.fasterxml.jackson.databind.ObjectMapper; + +import org.powermock.reflect.Whitebox; public class TestServiceExecutor { @@ -37,4 +43,15 @@ public class TestServiceExecutor { String requestData = "{\"vnf-id\":\"ibcx8888v\",\"current-request\" :{\"action\" : \"Audit\",\"action-identifiers\" : {\"service-instance-id\" : \"service-instance-id\",\"vnf-id\" : \"vnf-id\",\"vnfc-name\" : \"vnfc-name\",\"vf-module-id\" : \"vf-module-id\",\"vserver-id\": \"vserver-id\"}},\"in-progress-requests\" :[{\"action\" : \"HealthCheck\",\"action-identifiers\" : {\"service-instance-id\" : \"service-instance-id1\",\"vnf-id\" : \"vnf-id1\",\"vnfc-name\" : \"vnfc-name1\",\"vf-module-id\" : \"vf-module-id\",\"vserver-id\": \"vserver-id1\"}},{\"action\" : \"CheckLock\",\"action-identifiers\" : {\"service-instance-id\" : \"service-instance-id2\",\"vnf-id\" : \"vnf-id2\",\"vnfc-name\" : \"vnfc-name2\",\"vf-module-id\" : \"vf-module-id2\",\"vserver-id\": \"vserver-id2\"}}]}"; sei.isRequestOverLap(requestData); } + + @Test + public void isVserverOrVnfcIdOverLapTest() throws Exception{ + String requestData = "{\"vnf-id\":\"ibcx8888v\",\"current-request\" :{\"action\" : \"Audit\",\"action-identifiers\" : {\"vnf-id\" : \"vnf-id\",\"vf-module-id\" : \"vf-module-1234\"}},\"in-progress-requests\" :[{\"action\" : \"HealthCheck\",\"action-identifiers\" : {\"vnf-id\" : \"vnf-id1\",\"vf-module-id\":\"vf-module-1234\"}}]}"; + ServiceExecutorImpl sei = new ServiceExecutorImpl(); + ScopeOverlap scopeOverlap = new ScopeOverlap(); + ObjectMapper mapper = new ObjectMapper(); + scopeOverlap = mapper.readValue(requestData, ScopeOverlap.class); + boolean result = Whitebox.invokeMethod(sei, "isVserverOrVnfcIdOverLap",scopeOverlap); + assertEquals(true, result); + } } |