Upgrade Java 17 in policy-drools-apps
[policy/drools-applications.git] / controlloop / common / feature-controlloop-utils / src / test / java / org / onap / policy / drools / apps / controlloop / feature / utils / ControlLoopUtilsFeatureTest.java
index 5ba3758..5d1c52c 100644 (file)
@@ -2,7 +2,8 @@
  * ============LICENSE_START=======================================================
  * ONAP
  * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2023 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * limitations under the License.
  * ============LICENSE_END=========================================================
  */
+
 package org.onap.policy.drools.apps.controlloop.feature.utils;
 
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
-import org.junit.Test;
-import org.onap.policy.drools.http.server.HttpServletServer;
-import org.onap.policy.drools.system.PolicyEngine;
-import org.onap.policy.drools.utils.LoggerUtil;
+import org.junit.jupiter.api.Test;
+import org.onap.policy.common.endpoints.http.server.HttpServletServerFactoryInstance;
+import org.onap.policy.common.utils.logging.LoggerUtils;
+import org.onap.policy.drools.system.PolicyEngineConstants;
 import org.onap.policy.simulators.Util;
 
 /**
- * ControlLoopUtilsFeature JUnit Tests
+ * ControlLoopUtilsFeature JUnit Tests.
  */
-public class ControlLoopUtilsFeatureTest {
+class ControlLoopUtilsFeatureTest {
 
-  @Test
-  public void simulate() {
-    LoggerUtil.setLevel("ROOT", "INFO");
-    LoggerUtil.setLevel("org.eclipse.jetty", "WARN");
-    final ControlLoopUtilsFeature feature = new ControlLoopUtilsFeature();
-    feature.afterStart(PolicyEngine.manager);
-    assertNotNull(HttpServletServer.factory.get(Util.AAISIM_SERVER_PORT));
-    assertNotNull(HttpServletServer.factory.get(Util.SOSIM_SERVER_PORT));
-    assertNotNull(HttpServletServer.factory.get(Util.SOSIM_SERVER_PORT));
-  }
+    @Test
+    void testSimulate() {
+        LoggerUtils.setLevel("ROOT", "INFO");
+        LoggerUtils.setLevel("org.eclipse.jetty", "WARN");
+        final var feature = new ControlLoopUtilsFeature();
+        feature.afterStart(PolicyEngineConstants.getManager());
+        assertNotNull(HttpServletServerFactoryInstance.getServerFactory().get(Util.AAISIM_SERVER_PORT));
+        assertNotNull(HttpServletServerFactoryInstance.getServerFactory().get(Util.SOSIM_SERVER_PORT));
+        assertNotNull(HttpServletServerFactoryInstance.getServerFactory().get(Util.SOSIM_SERVER_PORT));
+        assertNotNull(HttpServletServerFactoryInstance.getServerFactory().get(Util.XACMLSIM_SERVER_PORT));
+        assertNotNull(HttpServletServerFactoryInstance.getServerFactory().get(Util.SDNCSIM_SERVER_PORT));
+    }
 
 }