diff options
author | jhh <jorge.hernandez-herrero@att.com> | 2020-02-26 09:59:43 -0600 |
---|---|---|
committer | jhh <jorge.hernandez-herrero@att.com> | 2020-02-26 09:59:43 -0600 |
commit | 04520679c94796757c5dda423ec52b78486e3186 (patch) | |
tree | a6a990731742a0e8075884bc5e6eb47ffa03a185 /feature-lifecycle/src/test | |
parent | ad08c16e0b23de071a6a17c29a792dd808ff26c0 (diff) |
narrow rest server data response for lifecycle
There may be a potential for getting stuck between gson utils, jetty
and fsm data.
Issue-ID: POLICY-2345
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Change-Id: Iec7d1a9db19d3c2eea830b2a51cd1fb1229c573a
Diffstat (limited to 'feature-lifecycle/src/test')
-rw-r--r-- | feature-lifecycle/src/test/java/org/onap/policy/drools/server/restful/RestLifecycleManagerTest.java | 10 |
1 files changed, 7 insertions, 3 deletions
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 cb65b57f..ae62095e 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 @@ -19,7 +19,6 @@ package org.onap.policy.drools.server.restful; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; import javax.ws.rs.core.Response; import javax.ws.rs.core.Response.Status; @@ -33,6 +32,7 @@ import org.onap.policy.common.endpoints.http.client.HttpClientFactoryInstance; import org.onap.policy.common.endpoints.http.server.HttpServletServer; import org.onap.policy.common.endpoints.http.server.HttpServletServerFactoryInstance; import org.onap.policy.common.utils.network.NetworkUtil; +import org.onap.policy.drools.lifecycle.LifecycleFeature; import org.onap.policy.drools.persistence.SystemPersistenceConstants; import org.onap.policy.models.pdp.enums.PdpState; @@ -80,8 +80,12 @@ public class RestLifecycleManagerTest { @Test public void testFsm() { - Response response = HttpClientFactoryInstance.getClientFactory().get("lifecycle").get("fsm"); - assertNotNull(HttpClient.getBody(response, String.class)); + Response response = HttpClientFactoryInstance.getClientFactory().get("lifecycle").get("fsm/group"); + assertEquals(LifecycleFeature.fsm.getGroup(), HttpClient.getBody(response, String.class)); + assertEquals(Status.OK.getStatusCode(), response.getStatus()); + + response = HttpClientFactoryInstance.getClientFactory().get("lifecycle").get("fsm/subgroup"); + assertEquals("", HttpClient.getBody(response, String.class)); assertEquals(Status.OK.getStatusCode(), response.getStatus()); response = HttpClientFactoryInstance.getClientFactory().get("lifecycle").get("fsm/state"); |