diff options
author | adheli.tavares <adheli.tavares@est.tech> | 2024-01-26 15:28:56 +0000 |
---|---|---|
committer | Adheli Tavares <adheli.tavares@est.tech> | 2024-02-09 10:31:15 +0000 |
commit | cc1d3d352771d1fa35d297e90663539e34b022f6 (patch) | |
tree | b1b00d678b0157742b91be1262fbf614a62063b1 /feature-legacy-config/src/test | |
parent | cce79248655f484e007769ba81b092148f940d27 (diff) |
Removing deprecated DMAAP library
Issue-ID: POLICY-4402
Change-Id: I4ce5b303cb3a775010683d3c7102b0bd065280ea
Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
Diffstat (limited to 'feature-legacy-config/src/test')
3 files changed, 34 insertions, 32 deletions
diff --git a/feature-legacy-config/src/test/java/org/onap/policy/drools/legacy/config/LegacyConfigFeatureTest.java b/feature-legacy-config/src/test/java/org/onap/policy/drools/legacy/config/LegacyConfigFeatureTest.java index d73817b8..c8371895 100644 --- a/feature-legacy-config/src/test/java/org/onap/policy/drools/legacy/config/LegacyConfigFeatureTest.java +++ b/feature-legacy-config/src/test/java/org/onap/policy/drools/legacy/config/LegacyConfigFeatureTest.java @@ -3,6 +3,7 @@ * ONAP * ================================================================================ * Copyright (C) 2021 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,25 +21,25 @@ package org.onap.policy.drools.legacy.config; -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 org.junit.After; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.onap.policy.common.endpoints.event.comm.bus.NoopTopicFactories; import org.onap.policy.drools.persistence.SystemPersistenceConstants; import org.onap.policy.drools.system.PolicyEngineConstants; -public class LegacyConfigFeatureTest { +class LegacyConfigFeatureTest { private LegacyConfigFeature configF; /** * Set up. */ - @Before + @BeforeEach public void setUp() { SystemPersistenceConstants.getManager().setConfigurationDir("target/test-classes"); configF = new LegacyConfigFeature(); @@ -47,7 +48,7 @@ public class LegacyConfigFeatureTest { /** * Tear down. */ - @After + @AfterEach public void tearDown() { NoopTopicFactories.getSourceFactory().destroy(); NoopTopicFactories.getSinkFactory().destroy(); @@ -55,12 +56,12 @@ public class LegacyConfigFeatureTest { } @Test - public void getSequenceNumber() { + void getSequenceNumber() { assertEquals(LegacyConfigFeature.SEQNO, new LegacyConfigFeature().getSequenceNumber()); } @Test - public void afterOpenBeforeShutdown() { + void afterOpenBeforeShutdown() { assertFalse(LegacyConfigFeature.getLegacyConfig().isAlive()); configF.afterOpen(PolicyEngineConstants.getManager()); assertTrue(LegacyConfigFeature.getLegacyConfig().isAlive()); diff --git a/feature-legacy-config/src/test/java/org/onap/policy/drools/legacy/config/LegacyConfigTest.java b/feature-legacy-config/src/test/java/org/onap/policy/drools/legacy/config/LegacyConfigTest.java index eb8860d2..09e03b3e 100644 --- a/feature-legacy-config/src/test/java/org/onap/policy/drools/legacy/config/LegacyConfigTest.java +++ b/feature-legacy-config/src/test/java/org/onap/policy/drools/legacy/config/LegacyConfigTest.java @@ -22,26 +22,26 @@ package org.onap.policy.drools.legacy.config; import static org.assertj.core.api.Assertions.assertThatIllegalStateException; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -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.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.onap.policy.common.endpoints.event.comm.Topic; import org.onap.policy.common.endpoints.event.comm.bus.NoopTopicFactories; import org.onap.policy.drools.persistence.SystemPersistenceConstants; -public class LegacyConfigTest { +class LegacyConfigTest { private static final String PDPD_CONFIGURATION_TOPIC = "pdpd-configuration"; /** * Set up. */ - @Before + @BeforeEach public void setUp() { SystemPersistenceConstants.getManager().setConfigurationDir("target/test-classes"); } @@ -49,7 +49,7 @@ public class LegacyConfigTest { /** * Tear down. */ - @After + @AfterEach public void tearDown() { NoopTopicFactories.getSourceFactory().destroy(); NoopTopicFactories.getSinkFactory().destroy(); @@ -57,7 +57,7 @@ public class LegacyConfigTest { } @Test - public void testStartStop() { + void testStartStop() { LegacyConfig config = new LegacyConfig(); assertFalse(config.isAlive()); @@ -75,7 +75,7 @@ public class LegacyConfigTest { } @Test - public void testConstructors() { + void testConstructors() { LegacyConfig config = new LegacyConfig(); assertNotNull(config.getProperties()); assertEquals(PDPD_CONFIGURATION_TOPIC, config.getSource().getTopic()); diff --git a/feature-legacy-config/src/test/java/org/onap/policy/drools/server/restful/RestLegacyConfigTest.java b/feature-legacy-config/src/test/java/org/onap/policy/drools/server/restful/RestLegacyConfigTest.java index 46bdb0f8..5180c486 100644 --- a/feature-legacy-config/src/test/java/org/onap/policy/drools/server/restful/RestLegacyConfigTest.java +++ b/feature-legacy-config/src/test/java/org/onap/policy/drools/server/restful/RestLegacyConfigTest.java @@ -1,6 +1,7 @@ /* * ============LICENSE_START======================================================= * Copyright (C) 2021 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. @@ -18,14 +19,14 @@ package org.onap.policy.drools.server.restful; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; import jakarta.ws.rs.core.Response; import java.util.Properties; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; import org.onap.policy.common.endpoints.event.comm.bus.internal.BusTopicParams; import org.onap.policy.common.endpoints.http.client.HttpClient; import org.onap.policy.common.endpoints.http.client.HttpClientFactoryInstance; @@ -45,7 +46,7 @@ public class RestLegacyConfigTest { /** * Set up. */ - @BeforeClass + @BeforeAll public static void setUp() throws Exception { SystemPersistenceConstants.getManager().setConfigurationDir("target/test-classes"); @@ -79,7 +80,7 @@ public class RestLegacyConfigTest { /** * Tear down. */ - @AfterClass + @AfterAll public static void tearDown() { LegacyConfigFeature.getLegacyConfig().shutdown(); HttpClientFactoryInstance.getClientFactory().destroy(); @@ -88,7 +89,7 @@ public class RestLegacyConfigTest { } @Test - public void properties() { + void properties() { Response response = client.get("properties"); assertEquals(Response.Status.OK.getStatusCode(), response.getStatus()); assertEquals(LegacyConfigFeature.getLegacyConfig().getProperties(), @@ -96,7 +97,7 @@ public class RestLegacyConfigTest { } @Test - public void topic() { + void topic() { Response response = client.get("source"); assertEquals(Response.Status.NOT_FOUND.getStatusCode(), response.getStatus()); } |