diff options
Diffstat (limited to 'feature-lifecycle')
7 files changed, 17 insertions, 67 deletions
diff --git a/feature-lifecycle/pom.xml b/feature-lifecycle/pom.xml index fb5cecbd..dd5faacf 100644 --- a/feature-lifecycle/pom.xml +++ b/feature-lifecycle/pom.xml @@ -20,13 +20,13 @@ --> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.onap.policy.drools-pdp</groupId> <artifactId>drools-pdp</artifactId> - <version>2.0.0-SNAPSHOT</version> + <version>2.0.1-SNAPSHOT</version> </parent> <artifactId>feature-lifecycle</artifactId> @@ -91,65 +91,22 @@ <version>${project.version}</version> <scope>provided</scope> </dependency> - <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <scope>provided</scope> </dependency> - - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <scope>test</scope> - </dependency> - - <dependency> - <groupId>org.assertj</groupId> - <artifactId>assertj-core</artifactId> - <scope>test</scope> - </dependency> - - <dependency> - <groupId>org.mockito</groupId> - <artifactId>mockito-core</artifactId> - <scope>test</scope> - </dependency> - - <dependency> - <groupId>org.onap.policy.common</groupId> - <artifactId>policy-endpoints</artifactId> - <version>${policy.common.version}</version> - <scope>provided</scope> - </dependency> - - <dependency> - <groupId>org.onap.policy.common</groupId> - <artifactId>utils-test</artifactId> - <version>${policy.common.version}</version> - <scope>test</scope> - </dependency> - <dependency> <groupId>org.onap.policy.common</groupId> <artifactId>gson</artifactId> <version>${policy.common.version}</version> </dependency> - - <dependency> - <groupId>org.onap.policy.common</groupId> - <artifactId>utils</artifactId> - <version>${policy.common.version}</version> - <scope>provided</scope> - </dependency> - <dependency> <groupId>org.onap.policy.models</groupId> <artifactId>policy-models-examples</artifactId> <version>${policy.models.version}</version> <scope>test</scope> </dependency> - <dependency> <groupId>commons-beanutils</groupId> <artifactId>commons-beanutils</artifactId> diff --git a/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/LifecycleFeature.java b/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/LifecycleFeature.java index 27d845b5..953f0b37 100644 --- a/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/LifecycleFeature.java +++ b/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/LifecycleFeature.java @@ -37,7 +37,7 @@ public class LifecycleFeature * Lifecycle FSM. */ @Getter - public static final LifecycleFsm fsm = new LifecycleFsm(); + public static LifecycleFsm fsm = new LifecycleFsm(); @Override public int getSequenceNumber() { diff --git a/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/LifecycleFsm.java b/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/LifecycleFsm.java index c946f3b2..c67367e0 100644 --- a/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/LifecycleFsm.java +++ b/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/LifecycleFsm.java @@ -623,7 +623,6 @@ public class LifecycleFsm implements Startable { return status; } - private boolean source() { List<TopicSource> sources = TopicEndpointManager.getManager().addTopicSources(properties); if (sources.isEmpty()) { diff --git a/feature-lifecycle/src/main/java/org/onap/policy/drools/server/restful/RestLifecycleManager.java b/feature-lifecycle/src/main/java/org/onap/policy/drools/server/restful/RestLifecycleManager.java index cad980f5..6740700a 100644 --- a/feature-lifecycle/src/main/java/org/onap/policy/drools/server/restful/RestLifecycleManager.java +++ b/feature-lifecycle/src/main/java/org/onap/policy/drools/server/restful/RestLifecycleManager.java @@ -20,18 +20,18 @@ package org.onap.policy.drools.server.restful; import com.worldturner.medeia.api.ValidationFailedException; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.DELETE; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.POST; +import jakarta.ws.rs.PUT; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.PathParam; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; import java.util.Collections; import java.util.List; -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; import org.onap.policy.common.endpoints.http.server.YamlMessageBodyHandler; import org.onap.policy.common.utils.coder.CoderException; import org.onap.policy.common.utils.coder.StandardCoder; @@ -375,7 +375,6 @@ public class RestLifecycleManager implements LifecycleApi { return Response.status(Response.Status.OK).entity(Collections.emptyList()).build(); } - private Response deployUndeployOperation(String policy, boolean deploy) { var toscaPolicy = getToscaPolicy(policy); if (toscaPolicy == null) { diff --git a/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/ControllerSupport.java b/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/ControllerSupport.java index 4c1830b8..4e0b4bf7 100644 --- a/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/ControllerSupport.java +++ b/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/ControllerSupport.java @@ -135,14 +135,10 @@ public class ControllerSupport { * Change final marker in static field. */ public static <T> Field unsetFinalStaticAccess(Class<T> clazz, String fieldName) - throws NoSuchFieldException, IllegalAccessException { + throws NoSuchFieldException { Field field = clazz.getDeclaredField(fieldName); field.setAccessible(true); - Field modifiers = Field.class.getDeclaredField("modifiers"); - modifiers.setAccessible(true); - modifiers.setInt(field, field.getModifiers() & ~Modifier.FINAL); - return field; } diff --git a/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleFsmTest.java b/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleFsmTest.java index c08ac9fe..e5fc13a8 100644 --- a/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleFsmTest.java +++ b/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleFsmTest.java @@ -202,7 +202,6 @@ public class LifecycleFsmTest { assertEquals("foo", fsm.getPdpType()); } - @Test public void testMergePolicies() { assertEquals(List.of(), fsm.getActivePolicies()); diff --git a/feature-lifecycle/src/test/java/org/onap/policy/drools/server/restful/RestLifecycleManagerTest.java b/feature-lifecycle/src/test/java/org/onap/policy/drools/server/restful/RestLifecycleManagerTest.java index 85294306..29ef5a77 100644 --- a/feature-lifecycle/src/test/java/org/onap/policy/drools/server/restful/RestLifecycleManagerTest.java +++ b/feature-lifecycle/src/test/java/org/onap/policy/drools/server/restful/RestLifecycleManagerTest.java @@ -25,15 +25,15 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; +import jakarta.ws.rs.client.Entity; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.Response.Status; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; import java.util.Collections; import java.util.List; import java.util.Properties; -import javax.ws.rs.client.Entity; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.Response.Status; import org.apache.commons.lang3.StringUtils; import org.junit.After; import org.junit.Before; |