summaryrefslogtreecommitdiffstats
path: root/models-interactions/model-actors/actor.sdnc/src/test
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2020-07-13 16:06:57 -0400
committerJim Hahn <jrh3@att.com>2020-07-13 16:07:54 -0400
commitc88676ec64c4c870252502bc1cfaa8990c8fd964 (patch)
treed88ec0ac29d5c3066fab025392df4a69256cf288 /models-interactions/model-actors/actor.sdnc/src/test
parente4e7d15db6d2f79658e3a5f9e8326ea092afcfab (diff)
Remove legacy actor code from models
Deleted legacy actor code. That includes deleting most of the XxxManager classes. Issue-ID: POLICY-2559 Change-Id: I1ef1b900ca1d23e88da64b2c95a18986feb1b765 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/SdncActorTest.java78
1 files changed, 1 insertions, 77 deletions
diff --git a/models-interactions/model-actors/actor.sdnc/src/test/java/org/onap/policy/controlloop/actor/sdnc/SdncActorTest.java b/models-interactions/model-actors/actor.sdnc/src/test/java/org/onap/policy/controlloop/actor/sdnc/SdncActorTest.java
index 020b09e8c..f0f280cb6 100644
--- a/models-interactions/model-actors/actor.sdnc/src/test/java/org/onap/policy/controlloop/actor/sdnc/SdncActorTest.java
+++ b/models-interactions/model-actors/actor.sdnc/src/test/java/org/onap/policy/controlloop/actor/sdnc/SdncActorTest.java
@@ -23,44 +23,16 @@
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 java.util.Arrays;
-import java.util.Objects;
-import java.util.UUID;
import java.util.stream.Collectors;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
import org.junit.Test;
-import org.onap.policy.common.endpoints.http.server.HttpServletServerFactoryInstance;
-import org.onap.policy.controlloop.ControlLoopOperation;
-import org.onap.policy.controlloop.VirtualControlLoopEvent;
import org.onap.policy.controlloop.actor.test.BasicActor;
-import org.onap.policy.controlloop.policy.Policy;
-import org.onap.policy.sdnc.SdncRequest;
public class SdncActorTest extends BasicActor {
- private static final String REROUTE = RerouteOperation.NAME;
-
- /**
- * Set up before test class.
- *
- * @throws Exception if the A&AI simulator cannot be started
- */
- @BeforeClass
- public static void setUpSimulator() throws Exception {
- org.onap.policy.simulators.Util.buildAaiSim();
- }
-
- @AfterClass
- public static void tearDownSimulator() {
- HttpServletServerFactoryInstance.getServerFactory().destroy();
- }
-
@Test
- public void testSdncActorServiceProvider() {
+ public void testSdncActor() {
final SdncActor prov = new SdncActor();
// verify that it has the operators we expect
@@ -73,52 +45,4 @@ public class SdncActorTest extends BasicActor {
// verify that it all plugs into the ActorService
verifyActorService(SdncActor.NAME, "service.yaml");
}
-
- @Test
- public void testConstructRequest() {
- VirtualControlLoopEvent onset = new VirtualControlLoopEvent();
- ControlLoopOperation operation = new ControlLoopOperation();
-
- Policy policy = new Policy();
- policy.setRecipe(REROUTE);
-
- SdncActor provider = new SdncActor();
- assertNull(provider.constructRequest(onset, operation, policy));
-
- onset.getAai().put("network-information.network-id", "network-5555");
- assertNull(provider.constructRequest(onset, operation, policy));
-
- assertNull(provider.constructRequest(onset, operation, policy));
-
- UUID requestId = UUID.randomUUID();
- onset.setRequestId(requestId);
- assertNull(provider.constructRequest(onset, operation, policy));
-
- assertNull(provider.constructRequest(onset, operation, policy));
-
- onset.getAai().put("service-instance.service-instance-id", "service-instance-01");
- assertNotNull(provider.constructRequest(onset, operation, policy));
-
- policy.setRecipe(REROUTE);
- assertNotNull(provider.constructRequest(onset, operation, policy));
-
- SdncRequest request = provider.constructRequest(onset, operation, policy);
-
- assertEquals(requestId, Objects.requireNonNull(request).getRequestId());
- assertEquals("reoptimize", request.getHealRequest().getRequestHeaderInfo().getSvcAction());
- assertEquals("ReoptimizeSOTNInstance", request.getHealRequest().getRequestInfo().getRequestAction());
- assertEquals("network-5555", request.getHealRequest().getNetworkInfo().getNetworkId());
- assertEquals("service-instance-01", request.getHealRequest().getServiceInfo().getServiceInstanceId());
- }
-
- @Test
- public void testMethods() {
- SdncActor sp = new SdncActor();
-
- 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());
- }
}