summaryrefslogtreecommitdiffstats
path: root/models-interactions/model-actors/actor.vfc
diff options
context:
space:
mode:
authorRam Krishna Verma <ram_krishna.verma@bell.ca>2020-06-10 19:40:40 +0000
committerGerrit Code Review <gerrit@onap.org>2020-06-10 19:40:40 +0000
commiteeb8d3b9c25e792e08ffe2d10b3f4b1d983a46fd (patch)
tree8759a7e2aff0445fcf3b5680b90c346959ef3a13 /models-interactions/model-actors/actor.vfc
parent5dc52f7d5b3dadc422e58823b1086084a25788a3 (diff)
parent5d4f44ab8e63d736817a7ae6795bb558a425660b (diff)
Merge "Flesh out junits for SDNR and VFC actors"
Diffstat (limited to 'models-interactions/model-actors/actor.vfc')
-rw-r--r--models-interactions/model-actors/actor.vfc/src/test/java/org/onap/policy/controlloop/actor/vfc/VfcActorServiceProviderTest.java23
-rw-r--r--models-interactions/model-actors/actor.vfc/src/test/resources/service.yaml34
2 files changed, 56 insertions, 1 deletions
diff --git a/models-interactions/model-actors/actor.vfc/src/test/java/org/onap/policy/controlloop/actor/vfc/VfcActorServiceProviderTest.java b/models-interactions/model-actors/actor.vfc/src/test/java/org/onap/policy/controlloop/actor/vfc/VfcActorServiceProviderTest.java
index db224b065..9e05f22e1 100644
--- a/models-interactions/model-actors/actor.vfc/src/test/java/org/onap/policy/controlloop/actor/vfc/VfcActorServiceProviderTest.java
+++ b/models-interactions/model-actors/actor.vfc/src/test/java/org/onap/policy/controlloop/actor/vfc/VfcActorServiceProviderTest.java
@@ -28,8 +28,10 @@ import static org.junit.Assert.assertNull;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
+import java.util.Arrays;
import java.util.Objects;
import java.util.UUID;
+import java.util.stream.Collectors;
import org.apache.commons.io.IOUtils;
import org.junit.AfterClass;
import org.junit.BeforeClass;
@@ -38,11 +40,12 @@ import org.onap.policy.aai.AaiCqResponse;
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.simulators.Util;
import org.onap.policy.vfc.VfcRequest;
-public class VfcActorServiceProviderTest {
+public class VfcActorServiceProviderTest extends BasicActor {
private static final String DOROTHY_GALE_1939 = "dorothy.gale.1939";
private static final String CQ_RESPONSE_JSON = "aai/AaiCqResponse.json";
@@ -63,6 +66,24 @@ public class VfcActorServiceProviderTest {
}
@Test
+ public void testConstructor() {
+ VfcActorServiceProvider prov = new VfcActorServiceProvider();
+ assertEquals(0, prov.getSequenceNumber());
+
+ // verify that it has the operators we expect
+ var expected = Arrays.asList(Restart.NAME).stream().sorted().collect(Collectors.toList());
+ var actual = prov.getOperationNames().stream().sorted().collect(Collectors.toList());
+
+ assertEquals(expected.toString(), actual.toString());
+ }
+
+ @Test
+ public void testActorService() {
+ // verify that it all plugs into the ActorService
+ verifyActorService(VfcActorServiceProvider.NAME, "service.yaml");
+ }
+
+ @Test
public void testMethods() {
VfcActorServiceProvider sp = new VfcActorServiceProvider();
diff --git a/models-interactions/model-actors/actor.vfc/src/test/resources/service.yaml b/models-interactions/model-actors/actor.vfc/src/test/resources/service.yaml
new file mode 100644
index 000000000..26192e013
--- /dev/null
+++ b/models-interactions/model-actors/actor.vfc/src/test/resources/service.yaml
@@ -0,0 +1,34 @@
+#
+# ============LICENSE_START======================================================
+# ONAP
+# ===============================================================================
+# Copyright (C) 2020 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========================================================
+#
+httpClients:
+- clientName: my-client
+ hostname: localhost
+ port: 80
+ basePath: base-url/
+ managed: true
+actors:
+ VFC:
+ Restart:
+ clientName: my-client
+ pathGet: jobs
+ maxGets: 20
+ waitSecGet: 20
+ path: ns
+ timeoutSec: 60