summaryrefslogtreecommitdiffstats
path: root/ms
diff options
context:
space:
mode:
Diffstat (limited to 'ms')
-rw-r--r--ms/gra/gra-app/src/main/java/org/onap/sdnc/apps/ms/gra/controllers/ConfigApiController.java4
-rw-r--r--ms/gra/gra-app/src/main/java/org/onap/sdnc/apps/ms/gra/data/ConfigPortMirrorConfigurations.java4
-rw-r--r--ms/gra/gra-app/src/test/java/org/onap/sdnc/apps/ms/gra/controllers/ConfigApiServicesControllerTest.java2
-rw-r--r--ms/gra/gra-app/src/test/java/org/onap/sdnc/apps/ms/gra/controllers/OperationsApiControllerTest.java2
-rw-r--r--ms/gra/gra-app/src/test/java/org/onap/sdnc/apps/ms/gra/data/ConfigContrailRouteAllottedResourcesTest.java85
-rw-r--r--ms/gra/gra-app/src/test/java/org/onap/sdnc/apps/ms/gra/data/ConfigPortMirrorConfigurationsTest.java82
-rw-r--r--ms/gra/gra-app/src/test/java/org/onap/sdnc/apps/ms/gra/data/OperationalContrailRouteAllottedResourcesTest.java85
-rw-r--r--ms/gra/gra-app/src/test/java/org/onap/sdnc/apps/ms/gra/data/OperationalPortMirrorConfigurationsTest.java82
8 files changed, 340 insertions, 6 deletions
diff --git a/ms/gra/gra-app/src/main/java/org/onap/sdnc/apps/ms/gra/controllers/ConfigApiController.java b/ms/gra/gra-app/src/main/java/org/onap/sdnc/apps/ms/gra/controllers/ConfigApiController.java
index 7508eb8..ac6a333 100644
--- a/ms/gra/gra-app/src/main/java/org/onap/sdnc/apps/ms/gra/controllers/ConfigApiController.java
+++ b/ms/gra/gra-app/src/main/java/org/onap/sdnc/apps/ms/gra/controllers/ConfigApiController.java
@@ -193,13 +193,13 @@ public class ConfigApiController implements ConfigApi {
portMirrorConfiguration = existingConfiguration.get(0);
} else {
portMirrorConfiguration = new ConfigPortMirrorConfigurations();
- portMirrorConfiguration.setConfigureationId(configurationId);
+ portMirrorConfiguration.setConfigurationId(configurationId);
}
try {
portMirrorConfiguration.setPmcData(objectMapper.writeValueAsString(newConfiguration.getConfigurationData()));
} catch (JsonProcessingException e) {
- log.error("Could not serialize porr-mirror configuration data for {}", portMirrorConfiguration.getConfigureationId(), e);
+ log.error("Could not serialize porr-mirror configuration data for {}", portMirrorConfiguration.getConfigurationId(), e);
throw new RestApplicationException("data-conversion", "Request could not be completed due to internal error", e, HttpStatus.INTERNAL_SERVER_ERROR.value());
}
diff --git a/ms/gra/gra-app/src/main/java/org/onap/sdnc/apps/ms/gra/data/ConfigPortMirrorConfigurations.java b/ms/gra/gra-app/src/main/java/org/onap/sdnc/apps/ms/gra/data/ConfigPortMirrorConfigurations.java
index cdc5462..347fe59 100644
--- a/ms/gra/gra-app/src/main/java/org/onap/sdnc/apps/ms/gra/data/ConfigPortMirrorConfigurations.java
+++ b/ms/gra/gra-app/src/main/java/org/onap/sdnc/apps/ms/gra/data/ConfigPortMirrorConfigurations.java
@@ -59,11 +59,11 @@ public class ConfigPortMirrorConfigurations {
}
}
- public String getConfigureationId() {
+ public String getConfigurationId() {
return configurationId;
}
- public void setConfigureationId(String configureationId) {
+ public void setConfigurationId(String configureationId) {
this.configurationId = configureationId;
}
diff --git a/ms/gra/gra-app/src/test/java/org/onap/sdnc/apps/ms/gra/controllers/ConfigApiServicesControllerTest.java b/ms/gra/gra-app/src/test/java/org/onap/sdnc/apps/ms/gra/controllers/ConfigApiServicesControllerTest.java
index 6a1b708..603ff20 100644
--- a/ms/gra/gra-app/src/test/java/org/onap/sdnc/apps/ms/gra/controllers/ConfigApiServicesControllerTest.java
+++ b/ms/gra/gra-app/src/test/java/org/onap/sdnc/apps/ms/gra/controllers/ConfigApiServicesControllerTest.java
@@ -1158,7 +1158,7 @@ public class ConfigApiServicesControllerTest {
for (GenericResourceApiPortmirrorconfigurationsPortMirrorConfiguration pmConfig : pmConfigurations.getPortMirrorConfiguration()) {
ConfigPortMirrorConfigurations newPmConfig = new ConfigPortMirrorConfigurations();
- newPmConfig.setConfigureationId(pmConfig.getConfigurationId());
+ newPmConfig.setConfigurationId(pmConfig.getConfigurationId());
newPmConfig.setPmcData(objectMapper.writeValueAsString(pmConfig.getConfigurationData()));
newPmConfig.setPortMirrorConfigurationStatus(pmConfig.getConfigurationStatus());
configPortMirrorConfigurationsRepository.save(newPmConfig);
diff --git a/ms/gra/gra-app/src/test/java/org/onap/sdnc/apps/ms/gra/controllers/OperationsApiControllerTest.java b/ms/gra/gra-app/src/test/java/org/onap/sdnc/apps/ms/gra/controllers/OperationsApiControllerTest.java
index 0b09f1b..5d624d8 100644
--- a/ms/gra/gra-app/src/test/java/org/onap/sdnc/apps/ms/gra/controllers/OperationsApiControllerTest.java
+++ b/ms/gra/gra-app/src/test/java/org/onap/sdnc/apps/ms/gra/controllers/OperationsApiControllerTest.java
@@ -347,7 +347,7 @@ public class OperationsApiControllerTest {
for (GenericResourceApiPortmirrorconfigurationsPortMirrorConfiguration pmConfig : pmConfigurations.getPortMirrorConfiguration()) {
ConfigPortMirrorConfigurations newPmConfig = new ConfigPortMirrorConfigurations();
- newPmConfig.setConfigureationId(pmConfig.getConfigurationId());
+ newPmConfig.setConfigurationId(pmConfig.getConfigurationId());
newPmConfig.setPmcData(objectMapper.writeValueAsString(pmConfig.getConfigurationData()));
newPmConfig.setPortMirrorConfigurationStatus(pmConfig.getConfigurationStatus());
configPortMirrorConfigurationsRepository.save(newPmConfig);
diff --git a/ms/gra/gra-app/src/test/java/org/onap/sdnc/apps/ms/gra/data/ConfigContrailRouteAllottedResourcesTest.java b/ms/gra/gra-app/src/test/java/org/onap/sdnc/apps/ms/gra/data/ConfigContrailRouteAllottedResourcesTest.java
new file mode 100644
index 0000000..ef456b8
--- /dev/null
+++ b/ms/gra/gra-app/src/test/java/org/onap/sdnc/apps/ms/gra/data/ConfigContrailRouteAllottedResourcesTest.java
@@ -0,0 +1,85 @@
+package org.onap.sdnc.apps.ms.gra.data;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import org.junit.Test;
+import org.onap.sdnc.apps.ms.gra.swagger.model.GenericResourceApiAllottedresourcestatusAllottedResourceStatus;
+import org.onap.sdnc.apps.ms.gra.swagger.model.GenericResourceApiRequestStatusEnumeration;
+import org.onap.sdnc.apps.ms.gra.swagger.model.GenericResourceApiRpcActionEnumeration;
+
+public class ConfigContrailRouteAllottedResourcesTest {
+
+ ConfigContrailRouteAllottedResources configContrailRouteAllottedResources;
+
+ @Test
+ public void testOneArgContructor() {
+ // No arg constructor
+ configContrailRouteAllottedResources = new ConfigContrailRouteAllottedResources();
+ assertEquals("",configContrailRouteAllottedResources.getAllottedResourceId());
+ assertEquals("", configContrailRouteAllottedResources.getArData());
+ }
+
+ @Test
+ public void testTwoArgConstructor() {
+
+ // 2 arg constructor
+ configContrailRouteAllottedResources = new ConfigContrailRouteAllottedResources("id1", "bogusData");
+ assertEquals("id1", configContrailRouteAllottedResources.getAllottedResourceId());
+ assertEquals("bogusData", configContrailRouteAllottedResources.getArData());
+ }
+
+ @Test
+ public void testThreeArgConstructor() {
+ // 3 arg constructor
+ GenericResourceApiAllottedresourcestatusAllottedResourceStatus resourceStatus = new GenericResourceApiAllottedresourcestatusAllottedResourceStatus();
+ resourceStatus.setAction("assign");
+ resourceStatus.setFinalIndicator("true");
+ resourceStatus.setRequestStatus(GenericResourceApiRequestStatusEnumeration.SYNCCOMPLETE);
+ resourceStatus.setResponseCode("200");
+ resourceStatus.setResponseMessage("Test message");
+ resourceStatus.setRpcAction(GenericResourceApiRpcActionEnumeration.ASSIGN);
+ resourceStatus.setRpcName("my-rpc");
+
+ configContrailRouteAllottedResources = new ConfigContrailRouteAllottedResources("id1", "bogusData",resourceStatus);
+
+ assertEquals("id1", configContrailRouteAllottedResources.getAllottedResourceId());
+ assertEquals("bogusData", configContrailRouteAllottedResources.getArData());
+ assertNotNull(configContrailRouteAllottedResources.getAllottedResourceStatus());
+ }
+
+ @Test
+ public void testGetsAndSets() {
+ configContrailRouteAllottedResources = new ConfigContrailRouteAllottedResources();
+ GenericResourceApiAllottedresourcestatusAllottedResourceStatus resourceStatus = new GenericResourceApiAllottedresourcestatusAllottedResourceStatus();
+ resourceStatus.setAction("assign");
+ resourceStatus.setFinalIndicator("true");
+ resourceStatus.setRequestStatus(GenericResourceApiRequestStatusEnumeration.SYNCCOMPLETE);
+ resourceStatus.setResponseCode("200");
+ resourceStatus.setResponseMessage("Test message");
+ resourceStatus.setRpcAction(GenericResourceApiRpcActionEnumeration.ASSIGN);
+ resourceStatus.setRpcName("my-rpc");
+
+ configContrailRouteAllottedResources.setAllottedResourceId("id1");
+ configContrailRouteAllottedResources.setAllottedResourceStatus(resourceStatus);
+ configContrailRouteAllottedResources.setAllottedResourceStatusAction("assign");
+ configContrailRouteAllottedResources.setAllottedResourceStatusFinalIndicator("true");
+ configContrailRouteAllottedResources.setAllottedResourceStatusRequestStatus("SYNC_COMPLETE");
+ configContrailRouteAllottedResources.setAllottedResourceStatusResponseCode("200");
+ configContrailRouteAllottedResources.setAllottedResourceStatusResponseMessage("Test message");
+ configContrailRouteAllottedResources.setAllottedResourceStatusResponseTimestamp("now");
+ configContrailRouteAllottedResources.setAllottedResourceStatusRpcAction("assign");
+ configContrailRouteAllottedResources.setAllottedResourceStatusRpcName("my-rpc");
+
+ assertEquals("id1", configContrailRouteAllottedResources.getAllottedResourceId());
+ assertNotNull(configContrailRouteAllottedResources.getAllottedResourceStatus());
+ assertEquals("assign", configContrailRouteAllottedResources.getAllottedResourceStatusAction());
+ assertEquals("true", configContrailRouteAllottedResources.getAllottedResourceStatusFinalIndicator());
+ assertEquals("SYNC_COMPLETE", configContrailRouteAllottedResources.getAllottedResourceStatusRequestStatus());
+ assertEquals("200", configContrailRouteAllottedResources.getAllottedResourceStatusResponseCode());
+ assertEquals("Test message", configContrailRouteAllottedResources.getAllottedResourceStatusResponseMessage());
+ assertEquals("now", configContrailRouteAllottedResources.getAllottedResourceStatusResponseTimestamp());
+ assertEquals("assign", configContrailRouteAllottedResources.getAllottedResourceStatusRpcAction());
+ assertEquals("my-rpc", configContrailRouteAllottedResources.getAllottedResourceStatusRpcName());
+ }
+}
diff --git a/ms/gra/gra-app/src/test/java/org/onap/sdnc/apps/ms/gra/data/ConfigPortMirrorConfigurationsTest.java b/ms/gra/gra-app/src/test/java/org/onap/sdnc/apps/ms/gra/data/ConfigPortMirrorConfigurationsTest.java
new file mode 100644
index 0000000..a3cfd38
--- /dev/null
+++ b/ms/gra/gra-app/src/test/java/org/onap/sdnc/apps/ms/gra/data/ConfigPortMirrorConfigurationsTest.java
@@ -0,0 +1,82 @@
+package org.onap.sdnc.apps.ms.gra.data;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import org.junit.Test;
+import org.onap.sdnc.apps.ms.gra.swagger.model.GenericResourceApiConfigurationstatusConfigurationStatus;
+import org.onap.sdnc.apps.ms.gra.swagger.model.GenericResourceApiRequestStatusEnumeration;
+import org.onap.sdnc.apps.ms.gra.swagger.model.GenericResourceApiRpcActionEnumeration;
+
+public class ConfigPortMirrorConfigurationsTest {
+ ConfigPortMirrorConfigurations portMirrorConfigurations;
+
+ @Test
+ public void testNoArgConstructor() {
+ portMirrorConfigurations = new ConfigPortMirrorConfigurations();
+ assertEquals("", portMirrorConfigurations.getConfigurationId());
+ assertEquals("", portMirrorConfigurations.getPmcData());
+ }
+
+ @Test
+ public void testTwoArgConstructor() {
+ portMirrorConfigurations = new ConfigPortMirrorConfigurations("id1", "bogusData");
+ assertEquals("id1", portMirrorConfigurations.getConfigurationId());
+ assertEquals("bogusData", portMirrorConfigurations.getPmcData());
+ }
+
+ @Test
+ public void testThreeArgConstructor() {
+ GenericResourceApiConfigurationstatusConfigurationStatus configStatus = new GenericResourceApiConfigurationstatusConfigurationStatus();
+ configStatus.setAction("assign");
+ configStatus.setFinalIndicator("true");
+ configStatus.setRequestStatus(GenericResourceApiRequestStatusEnumeration.SYNCCOMPLETE);
+ configStatus.setResponseCode("200");
+ configStatus.setResponseMessage("Test Message");
+ configStatus.setRpcAction(GenericResourceApiRpcActionEnumeration.ASSIGN);
+ configStatus.setRpcName("my-rpc");
+
+ portMirrorConfigurations = new ConfigPortMirrorConfigurations("id1", "bogusData", configStatus);
+ assertEquals("id1", portMirrorConfigurations.getConfigurationId());
+ assertEquals("bogusData", portMirrorConfigurations.getPmcData());
+ assertNotNull(portMirrorConfigurations.getPortMirrorConfigurationStatusRequestStatus());
+
+ }
+
+ @Test
+ public void testGettersAndSetters() {
+ GenericResourceApiConfigurationstatusConfigurationStatus configStatus = new GenericResourceApiConfigurationstatusConfigurationStatus();
+ configStatus.setAction("assign");
+ configStatus.setFinalIndicator("true");
+ configStatus.setRequestStatus(GenericResourceApiRequestStatusEnumeration.SYNCCOMPLETE);
+ configStatus.setResponseCode("200");
+ configStatus.setResponseMessage("Test Message");
+ configStatus.setRpcAction(GenericResourceApiRpcActionEnumeration.ASSIGN);
+ configStatus.setRpcName("my-rpc");
+ portMirrorConfigurations = new ConfigPortMirrorConfigurations();
+
+ portMirrorConfigurations.setConfigurationId("id1");
+ portMirrorConfigurations.setPmcData("bogusData");
+ portMirrorConfigurations.setPortMirrorConfigurationStatus(configStatus);
+ portMirrorConfigurations.setPortMirrorConfigurationStatusAction("assign");
+ portMirrorConfigurations.setPortMirrorConfigurationStatusFinalIndicator("true");
+ portMirrorConfigurations.setPortMirrorConfigurationStatusRequestStatus("SYNCCOMPLETE");
+ portMirrorConfigurations.setPortMirrorConfigurationStatusResponseCode("200");
+ portMirrorConfigurations.setPortMirrorConfigurationStatusResponseTimestamp("now");
+ portMirrorConfigurations.setPortMirrorConfigurationStatusRpcAction("assign");
+ portMirrorConfigurations.setPortMirrorConfigurationStatusRpcName("my-rpc");
+
+ assertEquals("id1", portMirrorConfigurations.getConfigurationId());
+ assertEquals("bogusData", portMirrorConfigurations.getPmcData());
+ assertNotNull(portMirrorConfigurations.getPortMirrorConfigurationStatus());
+ assertEquals("assign", portMirrorConfigurations.getPortMirrorConfigurationStatusAction());
+ assertEquals("true", portMirrorConfigurations.getPortMirrorConfigurationStatusFinalIndicator());
+ assertEquals("SYNCCOMPLETE", portMirrorConfigurations.getPortMirrorConfigurationStatusRequestStatus());
+ assertEquals("200", portMirrorConfigurations.getPortMirrorConfigurationStatusResponseCode());
+ assertEquals("now", portMirrorConfigurations.getPortMirrorConfigurationStatusResponseTimestamp());
+ assertEquals("assign", portMirrorConfigurations.getPortMirrorConfigurationStatusRpcAction());
+ assertEquals("my-rpc", portMirrorConfigurations.getPortMirrorConfigurationStatusRpcName());
+
+
+ }
+}
diff --git a/ms/gra/gra-app/src/test/java/org/onap/sdnc/apps/ms/gra/data/OperationalContrailRouteAllottedResourcesTest.java b/ms/gra/gra-app/src/test/java/org/onap/sdnc/apps/ms/gra/data/OperationalContrailRouteAllottedResourcesTest.java
new file mode 100644
index 0000000..13a78ee
--- /dev/null
+++ b/ms/gra/gra-app/src/test/java/org/onap/sdnc/apps/ms/gra/data/OperationalContrailRouteAllottedResourcesTest.java
@@ -0,0 +1,85 @@
+package org.onap.sdnc.apps.ms.gra.data;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import org.junit.Test;
+import org.onap.sdnc.apps.ms.gra.swagger.model.GenericResourceApiAllottedresourcestatusAllottedResourceStatus;
+import org.onap.sdnc.apps.ms.gra.swagger.model.GenericResourceApiRequestStatusEnumeration;
+import org.onap.sdnc.apps.ms.gra.swagger.model.GenericResourceApiRpcActionEnumeration;
+
+public class OperationalContrailRouteAllottedResourcesTest {
+
+ OperationalContrailRouteAllottedResources operationalContrailRouteAllottedResources;
+
+ @Test
+ public void testOneArgContructor() {
+ // No arg constructor
+ operationalContrailRouteAllottedResources = new OperationalContrailRouteAllottedResources();
+ assertEquals("",operationalContrailRouteAllottedResources.getAllottedResourceId());
+ assertEquals("", operationalContrailRouteAllottedResources.getArData());
+ }
+
+ @Test
+ public void testTwoArgConstructor() {
+
+ // 2 arg constructor
+ operationalContrailRouteAllottedResources = new OperationalContrailRouteAllottedResources("id1", "bogusData");
+ assertEquals("id1", operationalContrailRouteAllottedResources.getAllottedResourceId());
+ assertEquals("bogusData", operationalContrailRouteAllottedResources.getArData());
+ }
+
+ @Test
+ public void testThreeArgConstructor() {
+ // 3 arg constructor
+ GenericResourceApiAllottedresourcestatusAllottedResourceStatus resourceStatus = new GenericResourceApiAllottedresourcestatusAllottedResourceStatus();
+ resourceStatus.setAction("assign");
+ resourceStatus.setFinalIndicator("true");
+ resourceStatus.setRequestStatus(GenericResourceApiRequestStatusEnumeration.SYNCCOMPLETE);
+ resourceStatus.setResponseCode("200");
+ resourceStatus.setResponseMessage("Test message");
+ resourceStatus.setRpcAction(GenericResourceApiRpcActionEnumeration.ASSIGN);
+ resourceStatus.setRpcName("my-rpc");
+
+ operationalContrailRouteAllottedResources = new OperationalContrailRouteAllottedResources("id1", "bogusData",resourceStatus);
+
+ assertEquals("id1", operationalContrailRouteAllottedResources.getAllottedResourceId());
+ assertEquals("bogusData", operationalContrailRouteAllottedResources.getArData());
+ assertNotNull(operationalContrailRouteAllottedResources.getAllottedResourceStatus());
+ }
+
+ @Test
+ public void testGetsAndSets() {
+ operationalContrailRouteAllottedResources = new OperationalContrailRouteAllottedResources();
+ GenericResourceApiAllottedresourcestatusAllottedResourceStatus resourceStatus = new GenericResourceApiAllottedresourcestatusAllottedResourceStatus();
+ resourceStatus.setAction("assign");
+ resourceStatus.setFinalIndicator("true");
+ resourceStatus.setRequestStatus(GenericResourceApiRequestStatusEnumeration.SYNCCOMPLETE);
+ resourceStatus.setResponseCode("200");
+ resourceStatus.setResponseMessage("Test message");
+ resourceStatus.setRpcAction(GenericResourceApiRpcActionEnumeration.ASSIGN);
+ resourceStatus.setRpcName("my-rpc");
+
+ operationalContrailRouteAllottedResources.setAllottedResourceId("id1");
+ operationalContrailRouteAllottedResources.setAllottedResourceStatus(resourceStatus);
+ operationalContrailRouteAllottedResources.setAllottedResourceStatusAction("assign");
+ operationalContrailRouteAllottedResources.setAllottedResourceStatusFinalIndicator("true");
+ operationalContrailRouteAllottedResources.setAllottedResourceStatusRequestStatus("SYNC_COMPLETE");
+ operationalContrailRouteAllottedResources.setAllottedResourceStatusResponseCode("200");
+ operationalContrailRouteAllottedResources.setAllottedResourceStatusResponseMessage("Test message");
+ operationalContrailRouteAllottedResources.setAllottedResourceStatusResponseTimestamp("now");
+ operationalContrailRouteAllottedResources.setAllottedResourceStatusRpcAction("assign");
+ operationalContrailRouteAllottedResources.setAllottedResourceStatusRpcName("my-rpc");
+
+ assertEquals("id1", operationalContrailRouteAllottedResources.getAllottedResourceId());
+ assertNotNull(operationalContrailRouteAllottedResources.getAllottedResourceStatus());
+ assertEquals("assign", operationalContrailRouteAllottedResources.getAllottedResourceStatusAction());
+ assertEquals("true", operationalContrailRouteAllottedResources.getAllottedResourceStatusFinalIndicator());
+ assertEquals("SYNC_COMPLETE", operationalContrailRouteAllottedResources.getAllottedResourceStatusRequestStatus());
+ assertEquals("200", operationalContrailRouteAllottedResources.getAllottedResourceStatusResponseCode());
+ assertEquals("Test message", operationalContrailRouteAllottedResources.getAllottedResourceStatusResponseMessage());
+ assertEquals("now", operationalContrailRouteAllottedResources.getAllottedResourceStatusResponseTimestamp());
+ assertEquals("assign", operationalContrailRouteAllottedResources.getAllottedResourceStatusRpcAction());
+ assertEquals("my-rpc", operationalContrailRouteAllottedResources.getAllottedResourceStatusRpcName());
+ }
+}
diff --git a/ms/gra/gra-app/src/test/java/org/onap/sdnc/apps/ms/gra/data/OperationalPortMirrorConfigurationsTest.java b/ms/gra/gra-app/src/test/java/org/onap/sdnc/apps/ms/gra/data/OperationalPortMirrorConfigurationsTest.java
new file mode 100644
index 0000000..a515945
--- /dev/null
+++ b/ms/gra/gra-app/src/test/java/org/onap/sdnc/apps/ms/gra/data/OperationalPortMirrorConfigurationsTest.java
@@ -0,0 +1,82 @@
+package org.onap.sdnc.apps.ms.gra.data;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import org.junit.Test;
+import org.onap.sdnc.apps.ms.gra.swagger.model.GenericResourceApiConfigurationstatusConfigurationStatus;
+import org.onap.sdnc.apps.ms.gra.swagger.model.GenericResourceApiRequestStatusEnumeration;
+import org.onap.sdnc.apps.ms.gra.swagger.model.GenericResourceApiRpcActionEnumeration;
+
+public class OperationalPortMirrorConfigurationsTest {
+ OperationalPortMirrorConfigurations portMirrorConfigurations;
+
+ @Test
+ public void testNoArgConstructor() {
+ portMirrorConfigurations = new OperationalPortMirrorConfigurations();
+ assertEquals("", portMirrorConfigurations.getConfigurationId());
+ assertEquals("", portMirrorConfigurations.getPmcData());
+ }
+
+ @Test
+ public void testTwoArgConstructor() {
+ portMirrorConfigurations = new OperationalPortMirrorConfigurations("id1", "bogusData");
+ assertEquals("id1", portMirrorConfigurations.getConfigurationId());
+ assertEquals("bogusData", portMirrorConfigurations.getPmcData());
+ }
+
+ @Test
+ public void testThreeArgConstructor() {
+ GenericResourceApiConfigurationstatusConfigurationStatus configStatus = new GenericResourceApiConfigurationstatusConfigurationStatus();
+ configStatus.setAction("assign");
+ configStatus.setFinalIndicator("true");
+ configStatus.setRequestStatus(GenericResourceApiRequestStatusEnumeration.SYNCCOMPLETE);
+ configStatus.setResponseCode("200");
+ configStatus.setResponseMessage("Test Message");
+ configStatus.setRpcAction(GenericResourceApiRpcActionEnumeration.ASSIGN);
+ configStatus.setRpcName("my-rpc");
+
+ portMirrorConfigurations = new OperationalPortMirrorConfigurations("id1", "bogusData", configStatus);
+ assertEquals("id1", portMirrorConfigurations.getConfigurationId());
+ assertEquals("bogusData", portMirrorConfigurations.getPmcData());
+ assertNotNull(portMirrorConfigurations.getPortMirrorConfigurationStatusRequestStatus());
+
+ }
+
+ @Test
+ public void testGettersAndSetters() {
+ GenericResourceApiConfigurationstatusConfigurationStatus configStatus = new GenericResourceApiConfigurationstatusConfigurationStatus();
+ configStatus.setAction("assign");
+ configStatus.setFinalIndicator("true");
+ configStatus.setRequestStatus(GenericResourceApiRequestStatusEnumeration.SYNCCOMPLETE);
+ configStatus.setResponseCode("200");
+ configStatus.setResponseMessage("Test Message");
+ configStatus.setRpcAction(GenericResourceApiRpcActionEnumeration.ASSIGN);
+ configStatus.setRpcName("my-rpc");
+ portMirrorConfigurations = new OperationalPortMirrorConfigurations();
+
+ portMirrorConfigurations.setConfigurationId("id1");
+ portMirrorConfigurations.setPmcData("bogusData");
+ portMirrorConfigurations.setPortMirrorConfigurationStatus(configStatus);
+ portMirrorConfigurations.setPortMirrorConfigurationStatusAction("assign");
+ portMirrorConfigurations.setPortMirrorConfigurationStatusFinalIndicator("true");
+ portMirrorConfigurations.setPortMirrorConfigurationStatusRequestStatus("SYNCCOMPLETE");
+ portMirrorConfigurations.setPortMirrorConfigurationStatusResponseCode("200");
+ portMirrorConfigurations.setPortMirrorConfigurationStatusResponseTimestamp("now");
+ portMirrorConfigurations.setPortMirrorConfigurationStatusRpcAction("assign");
+ portMirrorConfigurations.setPortMirrorConfigurationStatusRpcName("my-rpc");
+
+ assertEquals("id1", portMirrorConfigurations.getConfigurationId());
+ assertEquals("bogusData", portMirrorConfigurations.getPmcData());
+ assertNotNull(portMirrorConfigurations.getPortMirrorConfigurationStatus());
+ assertEquals("assign", portMirrorConfigurations.getPortMirrorConfigurationStatusAction());
+ assertEquals("true", portMirrorConfigurations.getPortMirrorConfigurationStatusFinalIndicator());
+ assertEquals("SYNCCOMPLETE", portMirrorConfigurations.getPortMirrorConfigurationStatusRequestStatus());
+ assertEquals("200", portMirrorConfigurations.getPortMirrorConfigurationStatusResponseCode());
+ assertEquals("now", portMirrorConfigurations.getPortMirrorConfigurationStatusResponseTimestamp());
+ assertEquals("assign", portMirrorConfigurations.getPortMirrorConfigurationStatusRpcAction());
+ assertEquals("my-rpc", portMirrorConfigurations.getPortMirrorConfigurationStatusRpcName());
+
+
+ }
+}