From 411a7aa191a48170336dfa0fc5c44a17f99fd186 Mon Sep 17 00:00:00 2001 From: "a.sreekumar" Date: Mon, 14 Feb 2022 11:11:11 +0000 Subject: Fix swagger and improve exception handling 1) Swagger was getting generated in a different format due to a serialization isue. It is fixed. 2) Improved exception handling by taking care of any exceptions that could occur in and around database operations. 3) AAF enabling/disabling was done using spring profiles. This is changed to using parameters, as it is more easier to configure in an OOM helm chart deployment Change-Id: If1bee01379ba5c4efac29822662896d8aa883fc8 Issue-ID: POLICY-3975 Signed-off-by: a.sreekumar --- .../test/java/org/onap/policy/pap/main/rest/CommonPapRestServer.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'main/src/test/java/org') diff --git a/main/src/test/java/org/onap/policy/pap/main/rest/CommonPapRestServer.java b/main/src/test/java/org/onap/policy/pap/main/rest/CommonPapRestServer.java index c2d9f038..fd4bb742 100644 --- a/main/src/test/java/org/onap/policy/pap/main/rest/CommonPapRestServer.java +++ b/main/src/test/java/org/onap/policy/pap/main/rest/CommonPapRestServer.java @@ -51,11 +51,11 @@ import org.onap.policy.common.gson.GsonMessageBodyHandler; import org.onap.policy.common.utils.network.NetworkUtil; import org.onap.policy.common.utils.security.SelfSignedKeyStore; import org.onap.policy.common.utils.services.Registry; +import org.onap.policy.pap.main.PapConstants; import org.onap.policy.pap.main.PolicyPapApplication; import org.onap.policy.pap.main.parameters.CommonTestData; import org.onap.policy.pap.main.startstop.PapActivator; import org.powermock.reflect.Whitebox; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.web.server.LocalServerPort; import org.springframework.test.annotation.DirtiesContext; @@ -91,7 +91,6 @@ public abstract class CommonPapRestServer { @LocalServerPort private int port; - @Autowired private PapActivator papActivator; /** @@ -126,6 +125,7 @@ public abstract class CommonPapRestServer { @Before public void setUp() throws Exception { httpsPrefix = "https://localhost:" + port + "/"; + papActivator = Registry.get(PapConstants.REG_PAP_ACTIVATOR, PapActivator.class); activatorWasAlive = papActivator.isAlive(); } -- cgit 1.2.3-korg