diff options
Diffstat (limited to 'BRMSGateway/src/test/java/org/onap/brmsgw')
-rw-r--r-- | BRMSGateway/src/test/java/org/onap/brmsgw/test/BRMSJpaTest.java | 71 | ||||
-rw-r--r-- | BRMSGateway/src/test/java/org/onap/brmsgw/test/BRMSPushTest.java | 234 | ||||
-rw-r--r-- | BRMSGateway/src/test/java/org/onap/brmsgw/test/BrmsJpaTest.java | 73 | ||||
-rw-r--r-- | BRMSGateway/src/test/java/org/onap/brmsgw/test/BrmsPushTest.java | 235 | ||||
-rw-r--r-- | BRMSGateway/src/test/java/org/onap/brmsgw/test/ControllerPojoTest.java (renamed from BRMSGateway/src/test/java/org/onap/brmsgw/test/ControllerPOJOTest.java) | 36 | ||||
-rw-r--r-- | BRMSGateway/src/test/java/org/onap/brmsgw/test/NotificationPojoTest.java (renamed from BRMSGateway/src/test/java/org/onap/brmsgw/test/NotificationPOJOTest.java) | 38 |
6 files changed, 347 insertions, 340 deletions
diff --git a/BRMSGateway/src/test/java/org/onap/brmsgw/test/BRMSJpaTest.java b/BRMSGateway/src/test/java/org/onap/brmsgw/test/BRMSJpaTest.java deleted file mode 100644 index ffcc2e379..000000000 --- a/BRMSGateway/src/test/java/org/onap/brmsgw/test/BRMSJpaTest.java +++ /dev/null @@ -1,71 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP Policy Engine - * ================================================================================ - * Copyright (C) 2018 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.brmsgw.test; - -import static org.junit.Assert.assertEquals; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import org.junit.Test; -import org.onap.policy.api.PEDependency; -import org.onap.policy.brmsInterface.jpa.BRMSGroupInfo; -import org.onap.policy.brmsInterface.jpa.BRMSPolicyInfo; -import org.onap.policy.brmsInterface.jpa.DependencyInfo; - -public class BRMSJpaTest { - @Test - public void testJpa() { - String testVal = "testVal"; - BRMSGroupInfo groupInfo = new BRMSGroupInfo(); - - // Test group info - groupInfo.setControllerName(testVal); - assertEquals(groupInfo.getControllerName(), testVal); - groupInfo.setGroupId(testVal); - assertEquals(groupInfo.getGroupId(), testVal); - groupInfo.setArtifactId(testVal); - assertEquals(groupInfo.getArtifactId(), testVal); - groupInfo.setVersion(testVal); - assertEquals(groupInfo.getVersion(), testVal); - - // Test policy info - BRMSPolicyInfo policyInfo = new BRMSPolicyInfo(); - policyInfo.setPolicyName(testVal); - assertEquals(policyInfo.getPolicyName(), testVal); - policyInfo.setControllerName(groupInfo); - assertEquals(policyInfo.getControllerName(), groupInfo); - } - - @Test - public void testDependencyInfo() { - String testKey = "testKey"; - PEDependency dependency = new PEDependency(); - List<PEDependency> list = new ArrayList<PEDependency>(); - list.add(dependency); - Map<String, List<PEDependency>> map = new HashMap<String, List<PEDependency>>(); - map.put(testKey, list); - DependencyInfo info = new DependencyInfo(); - - info.setDependencies(map); - assertEquals(info.getDependencies(), map); - } -} diff --git a/BRMSGateway/src/test/java/org/onap/brmsgw/test/BRMSPushTest.java b/BRMSGateway/src/test/java/org/onap/brmsgw/test/BRMSPushTest.java deleted file mode 100644 index aa2574401..000000000 --- a/BRMSGateway/src/test/java/org/onap/brmsgw/test/BRMSPushTest.java +++ /dev/null @@ -1,234 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP Policy Engine - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.brmsgw.test; - -import static org.junit.Assert.assertNotNull; - -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.util.LinkedList; -import java.util.List; -import java.util.Properties; - -import org.junit.Test; -import org.onap.policy.api.PolicyException; -import org.onap.policy.brmsInterface.BRMSHandler; - -public class BRMSPushTest { - - private final String VALIDFILE = "src/test/resources/config.properties"; - private final String INVALIDFILE = "src/test/resources/failure.properties"; - - @Test (expected = PolicyException.class) - public void bRMSHandlerFailTest() throws PolicyException { - new BRMSHandler(null); - } - - @Test (expected = PolicyException.class) - public void bRMSHandlerFailTest1() throws PolicyException { - new BRMSHandler("src/test/resources/filenotexists.txt"); - } - - @Test (expected = PolicyException.class) - public void bRMSHandlerFailTest2() throws PolicyException { - PropertyChange prop = new PropertyChange(); - prop.key = "defaultName"; - prop.remove = true; - List<PropertyChange> props = new LinkedList<>(); - props.add(prop); - setFailureProperties(props); - new BRMSHandler(INVALIDFILE); - } - - @Test (expected = PolicyException.class) - public void bRMSHandlerFailTest3() throws PolicyException { - PropertyChange prop = new PropertyChange(); - prop.key = "repositoryID"; - prop.remove = true; - List<PropertyChange> props = new LinkedList<>(); - props.add(prop); - prop = new PropertyChange(); - prop.key = "RESOURCE_NAME"; - prop.remove = true; - props.add(prop); - setFailureProperties(props); - new BRMSHandler(INVALIDFILE); - } - - @Test (expected = PolicyException.class) - public void bRMSHandlerFailTest4() throws PolicyException { - PropertyChange prop = new PropertyChange(); - prop.key = "repositoryURL"; - prop.remove = true; - List<PropertyChange> props = new LinkedList<>(); - props.add(prop); - setFailureProperties(props); - new BRMSHandler(INVALIDFILE); - } - - @Test (expected = PolicyException.class) - public void bRMSHandlerFailTest5() throws PolicyException { - PropertyChange prop = new PropertyChange(); - prop.key = "repositoryName"; - prop.remove = true; - List<PropertyChange> props = new LinkedList<>(); - props.add(prop); - setFailureProperties(props); - new BRMSHandler(INVALIDFILE); - } - - @Test (expected = PolicyException.class) - public void bRMSHandlerFailTest6() throws PolicyException { - PropertyChange prop = new PropertyChange(); - prop.key = "repositoryURL"; - prop.value = "http://nexus:8081/nexus/content/repositories/releases, http://nexus:8081/nexus/content/repositories/releases"; - prop.remove = false; - List<PropertyChange> props = new LinkedList<>(); - props.add(prop); - prop = new PropertyChange(); - prop.key = "repositoryUsername"; - prop.remove = true; - props.add(prop); - setFailureProperties(props); - new BRMSHandler(INVALIDFILE); - } - - @Test (expected = PolicyException.class) - public void bRMSHandlerFailTest7() throws PolicyException { - PropertyChange prop = new PropertyChange(); - prop.key = "repositoryPassword"; - prop.remove = true; - List<PropertyChange> props = new LinkedList<>(); - props.add(prop); - setFailureProperties(props); - new BRMSHandler(INVALIDFILE); - } - - @Test (expected = PolicyException.class) - public void bRMSHandlerFailTest8() throws PolicyException { - PropertyChange prop = new PropertyChange(); - prop.key = "policyKeyID"; - prop.remove = true; - List<PropertyChange> props = new LinkedList<>(); - props.add(prop); - setFailureProperties(props); - new BRMSHandler(INVALIDFILE); - } - - @Test (expected = PolicyException.class) - public void bRMSHandlerFailTest9() throws PolicyException { - PropertyChange prop = new PropertyChange(); - prop.key = "sync"; - prop.value = "true"; - prop.remove = false; - List<PropertyChange> props = new LinkedList<>(); - props.add(prop); - prop = new PropertyChange(); - prop.key = "brms.dependency.version"; - prop.remove = true; - props.add(prop); - prop = new PropertyChange(); - prop.key = "groupNames"; - prop.remove = true; - props.add(prop); - setFailureProperties(props); - new BRMSHandler(INVALIDFILE); - } - - @Test (expected = PolicyException.class) - public void bRMSHandlerFailTest10() throws PolicyException { - PropertyChange prop = new PropertyChange(); - prop.key = "groupNames"; - prop.value = ""; - prop.remove = false; - List<PropertyChange> props = new LinkedList<>(); - props.add(prop); - setFailureProperties(props); - new BRMSHandler(INVALIDFILE); - } - - @Test (expected = PolicyException.class) - public void bRMSHandlerFailTest11() throws PolicyException { - PropertyChange prop = new PropertyChange(); - prop.key = "default.groupID"; - prop.remove = true; - List<PropertyChange> props = new LinkedList<>(); - props.add(prop); - setFailureProperties(props); - new BRMSHandler(INVALIDFILE); - } - - @Test (expected = PolicyException.class) - public void bRMSHandlerFailTest12() throws PolicyException { - PropertyChange prop = new PropertyChange(); - prop.key = "default.artifactID"; - prop.remove = true; - List<PropertyChange> props = new LinkedList<>(); - props.add(prop); - setFailureProperties(props); - new BRMSHandler(INVALIDFILE); - } - - @Test (expected = PolicyException.class) - public void bRMSHandlerFailTest13() throws PolicyException { - PropertyChange prop = new PropertyChange(); - prop.key = "NOTIFICATION_TYPE"; - prop.value = "dmaap"; - prop.remove = false; - List<PropertyChange> props = new LinkedList<>(); - props.add(prop); - prop = new PropertyChange(); - prop.key = "NOTIFICATION_SERVERS"; - prop.remove = true; - props.add(prop); - setFailureProperties(props); - new BRMSHandler(INVALIDFILE); - } - - @Test - public void BRMSHandlerTest() throws PolicyException { - assertNotNull(new BRMSHandler(VALIDFILE)); - } - - private void setFailureProperties(List<PropertyChange> properties) throws PolicyException { - Properties validProp = new Properties(); - try { - validProp.load(new FileInputStream(VALIDFILE)); - for (PropertyChange prop: properties) { - if(prop.remove) { - validProp.remove(prop.key); - }else { - validProp.setProperty(prop.key, prop.value); - } - } - validProp.store(new FileOutputStream(INVALIDFILE), null); - } catch (IOException e) { - throw new PolicyException(e); - } - } - - class PropertyChange { - public String key = null; - public String value = null; - public Boolean remove = false; - } -} diff --git a/BRMSGateway/src/test/java/org/onap/brmsgw/test/BrmsJpaTest.java b/BRMSGateway/src/test/java/org/onap/brmsgw/test/BrmsJpaTest.java new file mode 100644 index 000000000..32ed314d5 --- /dev/null +++ b/BRMSGateway/src/test/java/org/onap/brmsgw/test/BrmsJpaTest.java @@ -0,0 +1,73 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP Policy Engine + * ================================================================================ + * Copyright (C) 2018 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.brmsgw.test; + +import static org.junit.Assert.assertEquals; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.junit.Test; +import org.onap.policy.api.PEDependency; +import org.onap.policy.brms.entity.BrmsGroupInfo; +import org.onap.policy.brms.entity.BrmsPolicyInfo; +import org.onap.policy.brms.entity.DependencyInfo; + +public class BrmsJpaTest { + @Test + public void testJpa() { + final String testVal = "testVal"; + final BrmsGroupInfo groupInfo = new BrmsGroupInfo(); + + // Test group info + groupInfo.setControllerName(testVal); + assertEquals(groupInfo.getControllerName(), testVal); + groupInfo.setGroupId(testVal); + assertEquals(groupInfo.getGroupId(), testVal); + groupInfo.setArtifactId(testVal); + assertEquals(groupInfo.getArtifactId(), testVal); + groupInfo.setVersion(testVal); + assertEquals(groupInfo.getVersion(), testVal); + + // Test policy info + final BrmsPolicyInfo policyInfo = new BrmsPolicyInfo(); + policyInfo.setPolicyName(testVal); + assertEquals(policyInfo.getPolicyName(), testVal); + policyInfo.setControllerName(groupInfo); + assertEquals(policyInfo.getControllerName(), groupInfo); + } + + @Test + public void testDependencyInfo() { + final String testKey = "testKey"; + final PEDependency dependency = new PEDependency(); + final List<PEDependency> list = new ArrayList<PEDependency>(); + list.add(dependency); + final Map<String, List<PEDependency>> map = new HashMap<String, List<PEDependency>>(); + map.put(testKey, list); + final DependencyInfo info = new DependencyInfo(); + + info.setDependencies(map); + assertEquals(info.getDependencies(), map); + } +} diff --git a/BRMSGateway/src/test/java/org/onap/brmsgw/test/BrmsPushTest.java b/BRMSGateway/src/test/java/org/onap/brmsgw/test/BrmsPushTest.java new file mode 100644 index 000000000..36e633638 --- /dev/null +++ b/BRMSGateway/src/test/java/org/onap/brmsgw/test/BrmsPushTest.java @@ -0,0 +1,235 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP Policy Engine + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.brmsgw.test; + +import static org.junit.Assert.assertNotNull; + +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.util.LinkedList; +import java.util.List; +import java.util.Properties; + +import org.junit.Test; +import org.onap.policy.api.PolicyException; +import org.onap.policy.brms.api.BrmsHandler; + +public class BrmsPushTest { + + private static final String VALID_FILE = "src/test/resources/config.properties"; + private static final String INVALID_FILE = "src/test/resources/failure.properties"; + + @Test(expected = PolicyException.class) + public void brmsHandlerFailTest() throws PolicyException { + new BrmsHandler(null); + } + + @Test(expected = PolicyException.class) + public void brmsHandlerFailTest1() throws PolicyException { + new BrmsHandler("src/test/resources/filenotexists.txt"); + } + + @Test(expected = PolicyException.class) + public void brmsHandlerFailTest2() throws PolicyException { + final PropertyChange prop = new PropertyChange(); + prop.key = "defaultName"; + prop.remove = true; + final List<PropertyChange> props = new LinkedList<>(); + props.add(prop); + setFailureProperties(props); + new BrmsHandler(INVALID_FILE); + } + + @Test(expected = PolicyException.class) + public void brmsHandlerFailTest3() throws PolicyException { + PropertyChange prop = new PropertyChange(); + prop.key = "repositoryID"; + prop.remove = true; + final List<PropertyChange> props = new LinkedList<>(); + props.add(prop); + prop = new PropertyChange(); + prop.key = "RESOURCE_NAME"; + prop.remove = true; + props.add(prop); + setFailureProperties(props); + new BrmsHandler(INVALID_FILE); + } + + @Test(expected = PolicyException.class) + public void brmsHandlerFailTest4() throws PolicyException { + final PropertyChange prop = new PropertyChange(); + prop.key = "repositoryURL"; + prop.remove = true; + final List<PropertyChange> props = new LinkedList<>(); + props.add(prop); + setFailureProperties(props); + new BrmsHandler(INVALID_FILE); + } + + @Test(expected = PolicyException.class) + public void brmsHandlerFailTest5() throws PolicyException { + final PropertyChange prop = new PropertyChange(); + prop.key = "repositoryName"; + prop.remove = true; + final List<PropertyChange> props = new LinkedList<>(); + props.add(prop); + setFailureProperties(props); + new BrmsHandler(INVALID_FILE); + } + + @Test(expected = PolicyException.class) + public void brmsHandlerFailTest6() throws PolicyException { + PropertyChange prop = new PropertyChange(); + prop.key = "repositoryURL"; + prop.value = + "http://nexus:8081/nexus/content/repositories/releases, http://nexus:8081/nexus/content/repositories/releases"; + prop.remove = false; + final List<PropertyChange> props = new LinkedList<>(); + props.add(prop); + prop = new PropertyChange(); + prop.key = "repositoryUsername"; + prop.remove = true; + props.add(prop); + setFailureProperties(props); + new BrmsHandler(INVALID_FILE); + } + + @Test(expected = PolicyException.class) + public void brmsHandlerFailTest7() throws PolicyException { + final PropertyChange prop = new PropertyChange(); + prop.key = "repositoryPassword"; + prop.remove = true; + final List<PropertyChange> props = new LinkedList<>(); + props.add(prop); + setFailureProperties(props); + new BrmsHandler(INVALID_FILE); + } + + @Test(expected = PolicyException.class) + public void brmsHandlerFailTest8() throws PolicyException { + final PropertyChange prop = new PropertyChange(); + prop.key = "policyKeyID"; + prop.remove = true; + final List<PropertyChange> props = new LinkedList<>(); + props.add(prop); + setFailureProperties(props); + new BrmsHandler(INVALID_FILE); + } + + @Test(expected = PolicyException.class) + public void brmsHandlerFailTest9() throws PolicyException { + PropertyChange prop = new PropertyChange(); + prop.key = "sync"; + prop.value = "true"; + prop.remove = false; + final List<PropertyChange> props = new LinkedList<>(); + props.add(prop); + prop = new PropertyChange(); + prop.key = "brms.dependency.version"; + prop.remove = true; + props.add(prop); + prop = new PropertyChange(); + prop.key = "groupNames"; + prop.remove = true; + props.add(prop); + setFailureProperties(props); + new BrmsHandler(INVALID_FILE); + } + + @Test(expected = PolicyException.class) + public void brmsHandlerFailTest10() throws PolicyException { + final PropertyChange prop = new PropertyChange(); + prop.key = "groupNames"; + prop.value = ""; + prop.remove = false; + final List<PropertyChange> props = new LinkedList<>(); + props.add(prop); + setFailureProperties(props); + new BrmsHandler(INVALID_FILE); + } + + @Test(expected = PolicyException.class) + public void brmsHandlerFailTest11() throws PolicyException { + final PropertyChange prop = new PropertyChange(); + prop.key = "default.groupID"; + prop.remove = true; + final List<PropertyChange> props = new LinkedList<>(); + props.add(prop); + setFailureProperties(props); + new BrmsHandler(INVALID_FILE); + } + + @Test(expected = PolicyException.class) + public void brmsHandlerFailTest12() throws PolicyException { + final PropertyChange prop = new PropertyChange(); + prop.key = "default.artifactID"; + prop.remove = true; + final List<PropertyChange> props = new LinkedList<>(); + props.add(prop); + setFailureProperties(props); + new BrmsHandler(INVALID_FILE); + } + + @Test(expected = PolicyException.class) + public void brmsHandlerFailTest13() throws PolicyException { + PropertyChange prop = new PropertyChange(); + prop.key = "NOTIFICATION_TYPE"; + prop.value = "dmaap"; + prop.remove = false; + final List<PropertyChange> props = new LinkedList<>(); + props.add(prop); + prop = new PropertyChange(); + prop.key = "NOTIFICATION_SERVERS"; + prop.remove = true; + props.add(prop); + setFailureProperties(props); + new BrmsHandler(INVALID_FILE); + } + + @Test + public void brmsHandlerTest() throws PolicyException { + assertNotNull(new BrmsHandler(VALID_FILE)); + } + + private void setFailureProperties(final List<PropertyChange> properties) throws PolicyException { + final Properties validProp = new Properties(); + try { + validProp.load(new FileInputStream(VALID_FILE)); + for (final PropertyChange prop : properties) { + if (prop.remove) { + validProp.remove(prop.key); + } else { + validProp.setProperty(prop.key, prop.value); + } + } + validProp.store(new FileOutputStream(INVALID_FILE), null); + } catch (final IOException e) { + throw new PolicyException(e); + } + } + + class PropertyChange { + public String key = null; + public String value = null; + public Boolean remove = false; + } +} diff --git a/BRMSGateway/src/test/java/org/onap/brmsgw/test/ControllerPOJOTest.java b/BRMSGateway/src/test/java/org/onap/brmsgw/test/ControllerPojoTest.java index 5d736f61d..21534ddcd 100644 --- a/BRMSGateway/src/test/java/org/onap/brmsgw/test/ControllerPOJOTest.java +++ b/BRMSGateway/src/test/java/org/onap/brmsgw/test/ControllerPojoTest.java @@ -21,25 +21,27 @@ package org.onap.brmsgw.test; import static org.junit.Assert.assertEquals; + import java.util.HashMap; import java.util.Map; + import org.junit.Test; -import org.onap.policy.brmsInterface.ControllerPOJO; +import org.onap.policy.brms.api.ControllerPojo; + +public class ControllerPojoTest { + @Test + public void testPojo() { + final String testKey = "testKey"; + final String testVal = "testVal"; + final Map<String, String> testMap = new HashMap<String, String>(); + testMap.put(testKey, testVal); + final ControllerPojo pojo = new ControllerPojo(); -public class ControllerPOJOTest { - @Test - public void testPojo() { - String testKey = "testKey"; - String testVal = "testVal"; - Map<String, String> testMap = new HashMap<String, String>(); - testMap.put(testKey, testVal); - ControllerPOJO pojo = new ControllerPOJO(); - - pojo.setName(testVal); - assertEquals(pojo.getName(), testVal); - pojo.setDrools(testMap); - assertEquals(pojo.getDrools(), testMap); - pojo.setOperation(testVal); - assertEquals(pojo.getOperation(), testVal); - } + pojo.setName(testVal); + assertEquals(pojo.getName(), testVal); + pojo.setDrools(testMap); + assertEquals(pojo.getDrools(), testMap); + pojo.setOperation(testVal); + assertEquals(pojo.getOperation(), testVal); + } } diff --git a/BRMSGateway/src/test/java/org/onap/brmsgw/test/NotificationPOJOTest.java b/BRMSGateway/src/test/java/org/onap/brmsgw/test/NotificationPojoTest.java index ef6585f5d..f83b749f7 100644 --- a/BRMSGateway/src/test/java/org/onap/brmsgw/test/NotificationPOJOTest.java +++ b/BRMSGateway/src/test/java/org/onap/brmsgw/test/NotificationPojoTest.java @@ -21,26 +21,28 @@ package org.onap.brmsgw.test; import static org.junit.Assert.assertEquals; + import java.util.ArrayList; import java.util.List; + import org.junit.Test; -import org.onap.policy.brmsInterface.ControllerPOJO; -import org.onap.policy.brmsInterface.NotificationPOJO; +import org.onap.policy.brms.api.ControllerPojo; +import org.onap.policy.brms.api.NotificationPojo; + +public class NotificationPojoTest { + @Test + public void testPojo() { + final String testVal = "testVal"; + final ControllerPojo ctrlPojo = new ControllerPojo(); + final List<ControllerPojo> controllers = new ArrayList<ControllerPojo>(); + controllers.add(ctrlPojo); + final NotificationPojo pojo = new NotificationPojo(); -public class NotificationPOJOTest { - @Test - public void testPojo() { - String testVal = "testVal"; - ControllerPOJO ctrlPojo = new ControllerPOJO(); - List<ControllerPOJO> controllers = new ArrayList<ControllerPOJO>(); - controllers.add(ctrlPojo); - NotificationPOJO pojo = new NotificationPOJO(); - - pojo.setRequestID(testVal); - assertEquals(pojo.getRequestID(), testVal); - pojo.setEntity(testVal); - assertEquals(pojo.getEntity(), testVal); - pojo.setControllers(controllers); - assertEquals(pojo.getControllers(), controllers); - } + pojo.setRequestId(testVal); + assertEquals(pojo.getRequestId(), testVal); + pojo.setEntity(testVal); + assertEquals(pojo.getEntity(), testVal); + pojo.setControllers(controllers); + assertEquals(pojo.getControllers(), controllers); + } } |