* ONAP
* ================================================================================
* Copyright (C) 2017-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.
package org.onap.policy.drools.system;
import static org.awaitility.Awaitility.await;
-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 java.io.File;
import java.io.IOException;
import java.nio.file.Paths;
import java.util.Properties;
import java.util.concurrent.TimeUnit;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.FixMethodOrder;
-import org.junit.Test;
-import org.junit.runners.MethodSorters;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.MethodOrderer;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.TestMethodOrder;
import org.onap.policy.common.endpoints.event.comm.TopicEndpointManager;
import org.onap.policy.common.endpoints.event.comm.TopicSink;
import org.onap.policy.common.endpoints.event.comm.bus.NoopTopicFactories;
* PolicyEngine unit tests.
*/
-@FixMethodOrder(MethodSorters.NAME_ASCENDING)
-public class PolicyEngineTest {
+@TestMethodOrder(MethodOrderer.DisplayName.class)
+class PolicyEngineTest {
/**
* Default Telemetry port for JUnits.
*/
*
* @throws IOException throws IO exception
*/
- @BeforeClass
- public static void startUp() throws IOException {
- logger.info("enter");
+ @BeforeAll
+ static void startUp() throws IOException {
+ logger.info("startUp");
gson = new GsonTestUtils();
}
}
- @AfterClass
- public static void tearDown() {
- logger.info("enter");
- cleanUpWorkingDir();
- }
-
@Test
- public void test100Configure() {
+ void test100Configure() {
var manager = (PolicyEngineManager) PolicyEngineConstants.getManager();
var engineProps = manager.defaultTelemetryConfig();
}
@Test
- public void test200Start() {
+ void test200Start() {
logger.info("enter");
PolicyEngineConstants.getManager().start();
}
@Test
- public void test300Lock() {
+ void test300Lock() {
logger.info("enter");
PolicyEngineConstants.getManager().lock();
}
@Test
- public void test301Unlock() {
+ void test301Unlock() {
logger.info("enter");
PolicyEngineConstants.getManager().unlock();
}
@Test
- public void test350TopicDeliver() {
+ void test350TopicDeliver() {
final Properties noopSinkProperties = new Properties();
noopSinkProperties.put(PolicyEndPointProperties.PROPERTY_NOOP_SINK_TOPICS, NOOP_TOPIC);
}
@Test
- public void test400ControllerAdd() {
+ void test400ControllerAdd() {
logger.info("enter");
final Properties controllerProperties = new Properties();
}
@Test
- public void test401ControllerVerify() {
+ void test401ControllerVerify() {
logger.info("enter");
final PolicyController testController = PolicyControllerConstants.getFactory().get(TEST_CONTROLLER_NAME);
}
@Test
- public void test500Deactivate() {
+ void test500Deactivate() {
logger.info("enter");
PolicyEngineConstants.getManager().deactivate();
}
@Test
- public void test501Activate() {
+ void test501Activate() {
logger.info("enter");
PolicyEngineConstants.getManager().activate();
}
@Test
- public void test900ControllerRemove() {
+ void test900ControllerRemove() {
logger.info("enter");
PolicyEngineConstants.getManager().removePolicyController(TEST_CONTROLLER_NAME);
}
@Test
- public void test901Stop() {
+ void test901Stop() {
logger.info("enter");
/* Shutdown managed resources */