summaryrefslogtreecommitdiffstats
path: root/models-interactions/model-actors/actor.a1p
diff options
context:
space:
mode:
Diffstat (limited to 'models-interactions/model-actors/actor.a1p')
-rw-r--r--models-interactions/model-actors/actor.a1p/src/test/java/org/onap/policy/controlloop/actor/a1p/A1pActorTest.java17
-rw-r--r--models-interactions/model-actors/actor.a1p/src/test/java/org/onap/policy/controlloop/actor/a1p/A1pOperationTest.java48
-rw-r--r--models-interactions/model-actors/actor.a1p/src/test/java/org/onap/policy/controlloop/actor/a1p/BasicA1pOperation.java11
3 files changed, 39 insertions, 37 deletions
diff --git a/models-interactions/model-actors/actor.a1p/src/test/java/org/onap/policy/controlloop/actor/a1p/A1pActorTest.java b/models-interactions/model-actors/actor.a1p/src/test/java/org/onap/policy/controlloop/actor/a1p/A1pActorTest.java
index 654c35878..c22206c3f 100644
--- a/models-interactions/model-actors/actor.a1p/src/test/java/org/onap/policy/controlloop/actor/a1p/A1pActorTest.java
+++ b/models-interactions/model-actors/actor.a1p/src/test/java/org/onap/policy/controlloop/actor/a1p/A1pActorTest.java
@@ -2,6 +2,7 @@
* ONAP
* ================================================================================
* Copyright (C) 2022 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2024 Nordix Foundation
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,20 +20,20 @@
package org.onap.policy.controlloop.actor.a1p;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertSame;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertSame;
import java.util.stream.Collectors;
import java.util.stream.Stream;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.onap.policy.controlloop.actor.test.BasicActor;
import org.onap.policy.controlloop.actorserviceprovider.Operator;
-public class A1pActorTest extends BasicActor {
+class A1pActorTest extends BasicActor {
@Test
- public void testConstructor() {
+ void testConstructor() {
A1pActor prov = new A1pActor();
assertEquals(0, prov.getSequenceNumber());
@@ -44,13 +45,13 @@ public class A1pActorTest extends BasicActor {
}
@Test
- public void testActorService() {
+ void testActorService() {
// verify that it all plugs into the ActorService
verifyActorService(A1pActor.NAME, "service.yaml");
}
@Test
- public void testGetOperator() {
+ void testGetOperator() {
A1pActor sp = new A1pActor();
// should always return the same operator regardless of the name
diff --git a/models-interactions/model-actors/actor.a1p/src/test/java/org/onap/policy/controlloop/actor/a1p/A1pOperationTest.java b/models-interactions/model-actors/actor.a1p/src/test/java/org/onap/policy/controlloop/actor/a1p/A1pOperationTest.java
index 1d8e77147..930888da2 100644
--- a/models-interactions/model-actors/actor.a1p/src/test/java/org/onap/policy/controlloop/actor/a1p/A1pOperationTest.java
+++ b/models-interactions/model-actors/actor.a1p/src/test/java/org/onap/policy/controlloop/actor/a1p/A1pOperationTest.java
@@ -3,7 +3,7 @@
* ONAP
* ================================================================================
* Copyright (C) 2022 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2023 Nordix Foundation.
+ * Modifications Copyright (C) 2023, 2024 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,69 +22,69 @@
package org.onap.policy.controlloop.actor.a1p;
import static org.assertj.core.api.Assertions.assertThat;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertSame;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertSame;
import java.util.List;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.junit.MockitoJUnitRunner;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.mockito.junit.jupiter.MockitoExtension;
import org.onap.policy.controlloop.actor.test.BasicBidirectionalTopicOperation;
import org.onap.policy.controlloop.actorserviceprovider.OperationProperties;
import org.onap.policy.controlloop.actorserviceprovider.OperationResult;
import org.onap.policy.sdnr.util.StatusCodeEnum;
-@RunWith(MockitoJUnitRunner.class)
-public class A1pOperationTest extends BasicA1pOperation {
+@ExtendWith(MockitoExtension.class)
+ class A1pOperationTest extends BasicA1pOperation {
private A1pOperation operation;
- @BeforeClass
- public static void setUpBeforeClass() throws Exception {
+ @BeforeAll
+ static void setUpBeforeClass() throws Exception {
BasicBidirectionalTopicOperation.initBeforeClass(MY_SINK, MY_SOURCE);
}
- @AfterClass
- public static void tearDownAfterClass() {
+ @AfterAll
+ static void tearDownAfterClass() {
destroyAfterClass();
}
/**
* Setup.
*/
- @Before
+ @BeforeEach
@Override
- public void setUp() throws Exception {
+ void setUp() throws Exception {
super.setUp();
operation = new A1pOperation(params, config);
operation.setProperty(OperationProperties.EVENT_PAYLOAD, "my payload");
}
- @After
+ @AfterEach
@Override
- public void tearDown() {
+ void tearDown() {
super.tearDown();
}
@Test
- public void testA1pOperation() {
+ void testA1pOperation() {
assertEquals(DEFAULT_ACTOR, operation.getActorName());
assertEquals(DEFAULT_OPERATION, operation.getName());
}
@Test
- public void testGetPropertyNames() {
+ void testGetPropertyNames() {
assertThat(operation.getPropertyNames()).isEqualTo(List.of(OperationProperties.EVENT_PAYLOAD));
}
@Test
- public void testSetOutcome() {
+ void testSetOutcome() {
// with a status value
checkOutcome();
assertEquals(StatusCodeEnum.SUCCESS.toString(), outcome.getMessage());
diff --git a/models-interactions/model-actors/actor.a1p/src/test/java/org/onap/policy/controlloop/actor/a1p/BasicA1pOperation.java b/models-interactions/model-actors/actor.a1p/src/test/java/org/onap/policy/controlloop/actor/a1p/BasicA1pOperation.java
index 410dab176..3620b0cef 100644
--- a/models-interactions/model-actors/actor.a1p/src/test/java/org/onap/policy/controlloop/actor/a1p/BasicA1pOperation.java
+++ b/models-interactions/model-actors/actor.a1p/src/test/java/org/onap/policy/controlloop/actor/a1p/BasicA1pOperation.java
@@ -3,6 +3,7 @@
* ONAP
* ================================================================================
* Copyright (C) 2022 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2024 Nordix Foundation
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,9 +21,9 @@
package org.onap.policy.controlloop.actor.a1p;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.verify;
@@ -68,7 +69,7 @@ public abstract class BasicA1pOperation extends BasicBidirectionalTopicOperation
/**
* Initializes mocks and sets up.
*/
- public void setUp() throws Exception {
+ void setUp() throws Exception {
super.setUpBasic();
response = new PciMessage();
@@ -85,7 +86,7 @@ public abstract class BasicA1pOperation extends BasicBidirectionalTopicOperation
status.setValue(StatusCodeEnum.SUCCESS.toString());
}
- public void tearDown() {
+ void tearDown() {
super.tearDownBasic();
}