summaryrefslogtreecommitdiffstats
path: root/models-interactions/model-actors/actor.sdnc/src/test
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2019-06-13 10:39:55 -0400
committerJim Hahn <jrh3@att.com>2019-06-17 10:50:16 -0400
commitd37c71292d9cbdd892f328d63f49a8027b1f13c4 (patch)
tree615a8af45285d1032a02af1214c76b938c58044d /models-interactions/model-actors/actor.sdnc/src/test
parentf59ec395bf1e41df894f884e70ff3185280668c0 (diff)
Fix simple sonar issues in models
Added @FunctionalInterface where needed. Replaced anonymous classes with lambda expressions. Replaced duplicate strings with a constant. Removed unused BeforeClass & AfterClass test methods. Removed some trailing spaces. Fixed: aai actor.appc actor.appclcm actor.sdnc actor.sdnr actor.so actor.vfc actorServiceProvider appc appclcm cds events Change-Id: I0e21cbb10db6d1217bbd0e00e6dd4fac3eb84e31 Issue-ID: POLICY-1791 Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'models-interactions/model-actors/actor.sdnc/src/test')
-rw-r--r--models-interactions/model-actors/actor.sdnc/src/test/java/org/onap/policy/controlloop/actor/sdnc/SdncActorServiceProviderTest.java25
1 files changed, 11 insertions, 14 deletions
diff --git a/models-interactions/model-actors/actor.sdnc/src/test/java/org/onap/policy/controlloop/actor/sdnc/SdncActorServiceProviderTest.java b/models-interactions/model-actors/actor.sdnc/src/test/java/org/onap/policy/controlloop/actor/sdnc/SdncActorServiceProviderTest.java
index c80a38d77..26f7336d6 100644
--- a/models-interactions/model-actors/actor.sdnc/src/test/java/org/onap/policy/controlloop/actor/sdnc/SdncActorServiceProviderTest.java
+++ b/models-interactions/model-actors/actor.sdnc/src/test/java/org/onap/policy/controlloop/actor/sdnc/SdncActorServiceProviderTest.java
@@ -25,11 +25,9 @@ package org.onap.policy.controlloop.actor.sdnc;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
-import static org.junit.Assert.fail;
import java.util.Objects;
import java.util.UUID;
-
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -42,16 +40,15 @@ import org.onap.policy.simulators.Util;
public class SdncActorServiceProviderTest {
+ private static final String REROUTE = "Reroute";
+
/**
- * Set up for test class.
+ * Set up before test class.
+ * @throws Exception if the A&AI simulator cannot be started
*/
@BeforeClass
- public static void setUpSimulator() {
- try {
- Util.buildAaiSim();
- } catch (Exception e) {
- fail(e.getMessage());
- }
+ public static void setUpSimulator() throws Exception {
+ Util.buildAaiSim();
}
@AfterClass
@@ -65,7 +62,7 @@ public class SdncActorServiceProviderTest {
ControlLoopOperation operation = new ControlLoopOperation();
Policy policy = new Policy();
- policy.setRecipe("Reroute");
+ policy.setRecipe(REROUTE);
SdncActorServiceProvider provider = new SdncActorServiceProvider();
assertNull(provider.constructRequest(onset, operation, policy));
@@ -84,7 +81,7 @@ public class SdncActorServiceProviderTest {
onset.getAai().put("service-instance.service-instance-id", "service-instance-01");
assertNotNull(provider.constructRequest(onset, operation, policy));
- policy.setRecipe("Reroute");
+ policy.setRecipe(REROUTE);
assertNotNull(provider.constructRequest(onset, operation, policy));
SdncRequest request =
@@ -103,8 +100,8 @@ public class SdncActorServiceProviderTest {
assertEquals("SDNC", sp.actor());
assertEquals(1, sp.recipes().size());
- assertEquals("Reroute", sp.recipes().get(0));
- assertEquals("VM", sp.recipeTargets("Reroute").get(0));
- assertEquals(0, sp.recipePayloads("Reroute").size());
+ assertEquals(REROUTE, sp.recipes().get(0));
+ assertEquals("VM", sp.recipeTargets(REROUTE).get(0));
+ assertEquals(0, sp.recipePayloads(REROUTE).size());
}
}