--- /dev/null
+{
+ "tosca_definitions_version": "tosca_simple_yaml_1_1_0",
+ "topology_template": {
+ "policies": [
+ {
+ "usecases": {
+ "type": "onap.policies.native.drools.Artifact",
+ "type_version": "1.0.0",
+ "name": "usecases.artifacts",
+ "version": "1.0.0",
+ "metadata": {
+ "policy-id": "usecases.artifacts"
+ },
+ "properties": {
+ "rulesArtifact": {
+ "groupId": "org.onap.policy.drools-applications.controlloop.common",
+ "artifactId": "controller-usecases",
+ "version": "1.6.1"
+ },
+ "controller": {
+ "name": "usecases"
+ }
+ }
+ }
+ }
+ ]
+ }
+}
--- /dev/null
+tosca_definitions_version: tosca_simple_yaml_1_1_0
+topology_template:
+ policies:
+ - usecases:
+ type: onap.policies.native.drools.Artifact
+ type_version: 1.0.0
+ name: usecases.artifacts
+ version: 1.0.0
+ metadata:
+ policy-id: usecases.artifacts
+ properties:
+ rulesArtifact:
+ groupId: org.onap.policy.drools-applications.controlloop.common
+ artifactId: controller-usecases
+ version: 1.6.1
+ controller:
+ name: usecases
{
- "tosca_definitions_version": "tosca_simple_yaml_1_0_0",
+ "tosca_definitions_version": "tosca_simple_yaml_1_1_0",
"topology_template": {
"policies": [
{
-tosca_definitions_version: tosca_simple_yaml_1_0_0
+tosca_definitions_version: tosca_simple_yaml_1_1_0
topology_template:
policies:
- usecases:
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
+ <dependency>
+ <groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
+ <artifactId>actor.test</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
* ============LICENSE_START=======================================================
* Copyright (C) 2019 Bell Canada. All rights reserved.
* Modifications Copyright (C) 2020 Nordix Foundation.
+ * Modifications 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.
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyLong;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyLong;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import com.google.common.collect.ImmutableMap;
import com.google.protobuf.Struct;
-
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
import java.util.UUID;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
-
import org.junit.Before;
import org.junit.Test;
-import org.junit.runner.RunWith;
import org.mockito.Mock;
-import org.mockito.runners.MockitoJUnitRunner;
+import org.mockito.MockitoAnnotations;
import org.onap.ccsdk.cds.controllerblueprints.common.api.ActionIdentifiers;
import org.onap.ccsdk.cds.controllerblueprints.common.api.CommonHeader;
import org.onap.ccsdk.cds.controllerblueprints.common.api.EventType;
import org.onap.policy.controlloop.VirtualControlLoopEvent;
import org.onap.policy.controlloop.actor.cds.CdsActorServiceProvider.CdsActorServiceManager;
import org.onap.policy.controlloop.actor.cds.constants.CdsActorConstants;
+import org.onap.policy.controlloop.actor.test.BasicActor;
import org.onap.policy.controlloop.policy.Policy;
-@RunWith(MockitoJUnitRunner.class)
-public class CdsActorServiceProviderTest {
+public class CdsActorServiceProviderTest extends BasicActor {
private static final String CDS_BLUEPRINT_NAME = "vfw-cds";
private static final String CDS_BLUEPRINT_VERSION = "1.0.0";
*/
@Before
public void setup() {
+ MockitoAnnotations.initMocks(this);
+
// Setup policy
policy = new Policy();
Map<String, String> payloadMap = new HashMap<String, String>() {
assertEquals(CdsActorConstants.CDS_ACTOR, cdsActor.actor());
}
+ @Test
+ public void testActorService() {
+ // verify that it all plugs into the ActorService
+ verifyActorService(CdsActorConstants.CDS_ACTOR, "service.yaml");
+ }
+
@Test
public void testConstructRequestWhenMissingCdsParamsInPolicyPayload() {
policy.setPayload(new HashMap<>());
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2020 Bell Canada. All rights reserved.
+ * Modifications 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.
import java.util.concurrent.TimeoutException;
import org.junit.Before;
import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.runners.MockitoJUnitRunner;
+import org.mockito.MockitoAnnotations;
import org.onap.ccsdk.cds.controllerblueprints.common.api.EventType;
import org.onap.ccsdk.cds.controllerblueprints.common.api.Status;
import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceOutput;
import org.onap.policy.controlloop.actorserviceprovider.OperationOutcome;
import org.onap.policy.controlloop.policy.PolicyResult;
-@RunWith(MockitoJUnitRunner.class)
public class GrpcActorServiceManagerTest {
CdsActorServiceManager manager;
*/
@Before
public void setUp() throws Exception {
+ MockitoAnnotations.initMocks(this);
future = new CompletableFuture<>();
manager = new CdsActorServiceManager(new OperationOutcome(), future);
}
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2020 Bell Canada. All rights reserved.
+ * Modifications 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.
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.eq;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import java.util.concurrent.atomic.AtomicBoolean;
import org.junit.Before;
import org.junit.Test;
-import org.junit.runner.RunWith;
import org.mockito.Mock;
-import org.mockito.runners.MockitoJUnitRunner;
+import org.mockito.MockitoAnnotations;
import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceInput;
import org.onap.policy.aai.AaiCqResponse;
import org.onap.policy.cds.client.CdsProcessorGrpcClient;
import org.onap.policy.controlloop.actorserviceprovider.parameters.ControlLoopOperationParams;
import org.onap.policy.controlloop.policy.PolicyResult;
-@RunWith(MockitoJUnitRunner.class)
public class GrpcOperationTest {
private static final String CDS_BLUEPRINT_NAME = "vfw-cds";
*/
@Before
public void setUp() throws Exception {
+ MockitoAnnotations.initMocks(this);
// Setup the CDS properties
cdsProps = new CdsServerProperties();
--- /dev/null
+#
+# ============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========================================================
+#
+actors:
+ CDS:
+ gRPC:
+ timeout: 10
+ port: 6700
+ host: my-host
+ username: my-user
+ password: my-pass
#!/bin/bash
#
# ============LICENSE_START=======================================================
-# Copyright (C) 2019 Nordix Foundation.
+# Copyright (C) 2019-2020 Nordix Foundation.
# ================================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
CONFIG_FILE="$PDP_SIM_HOME/etc/config/OnapPfConfig.json"
fi
-echo "PDP simulatior configuration file: $CONFIG_FILE
+echo "PDP simulator configuration file:" $CONFIG_FILE
$JAVA_HOME/bin/java \
-cp "$PDP_SIM_HOME/etc:$PDP_SIM_HOME/lib/*" \