diff options
author | Guo Ruijing <ruijing.guo@intel.com> | 2017-07-28 08:23:01 +0000 |
---|---|---|
committer | Guo Ruijing <ruijing.guo@intel.com> | 2017-07-28 08:23:30 +0000 |
commit | 6abeb297254942c48722c2da0e7c355d523fe307 (patch) | |
tree | f2b006ec6ca8804633e2f74a6f1b40c90683f1ea /policy-endpoints/src/test/java/org/openecomp | |
parent | d1d749ae390c276fc10c4985d0080f0a9ff7ff35 (diff) |
[POLICY-72] replace openecomp for drools-pdp
Change-Id: I8aa8e32d3ba10f7c655b50e97aaf6865514d4777
Signed-off-by: Guo Ruijing <ruijing.guo@intel.com>
Diffstat (limited to 'policy-endpoints/src/test/java/org/openecomp')
6 files changed, 0 insertions, 681 deletions
diff --git a/policy-endpoints/src/test/java/org/openecomp/policy/drools/http/server/test/HttpClientTest.java b/policy-endpoints/src/test/java/org/openecomp/policy/drools/http/server/test/HttpClientTest.java deleted file mode 100644 index a7d309a1..00000000 --- a/policy-endpoints/src/test/java/org/openecomp/policy/drools/http/server/test/HttpClientTest.java +++ /dev/null @@ -1,218 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * policy-endpoints - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.drools.http.server.test; - -import static org.junit.Assert.assertTrue; - -import java.util.ArrayList; -import java.util.Properties; - -import javax.ws.rs.core.Response; - -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; -import org.openecomp.policy.drools.http.client.HttpClient; -import org.openecomp.policy.drools.http.server.HttpServletServer; -import org.openecomp.policy.drools.properties.PolicyProperties; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class HttpClientTest { - - private static Logger logger = LoggerFactory.getLogger(HttpClientTest.class); - - @BeforeClass - public static void setUp() { - logger.info("-- setup() --"); - - /* echo server */ - - HttpServletServer echoServerNoAuth = HttpServletServer.factory.build("echo", "localhost", 6666, "/", false, true); - echoServerNoAuth.addServletPackage("/*", HttpClientTest.class.getPackage().getName()); - echoServerNoAuth.waitedStart(5000); - - /* no auth echo server */ - - HttpServletServer echoServerAuth = HttpServletServer.factory.build("echo", "localhost", 6667, "/", false, true); - echoServerAuth.setBasicAuthentication("x", "y", null); - echoServerAuth.addServletPackage("/*", HttpClientTest.class.getPackage().getName()); - echoServerAuth.waitedStart(5000); - } - - @AfterClass - public static void tearDown() { - logger.info("-- tearDown() --"); - - HttpServletServer.factory.destroy(); - HttpClient.factory.destroy(); - } - - @Test - public void testHttpNoAuthClient() throws Exception { - logger.info("-- testHttpNoAuthClient() --"); - - HttpClient client = HttpClient.factory.build("testHttpNoAuthClient", false, false, - "localhost", 6666, "junit/echo", - null, null, true); - Response response = client.get("hello"); - String body = HttpClient.getBody(response, String.class); - - assertTrue(response.getStatus() == 200); - assertTrue(body.equals("hello")); - } - - @Test - public void testHttpAuthClient() throws Exception { - logger.info("-- testHttpAuthClient() --"); - - HttpClient client = HttpClient.factory.build("testHttpAuthClient",false, false, - "localhost", 6667, "junit/echo", - "x", "y", true); - Response response = client.get("hello"); - String body = HttpClient.getBody(response, String.class); - - assertTrue(response.getStatus() == 200); - assertTrue(body.equals("hello")); - } - - @Test - public void testHttpAuthClient401() throws Exception { - logger.info("-- testHttpAuthClient401() --"); - - HttpClient client = HttpClient.factory.build("testHttpAuthClient401",false, false, - "localhost", 6667, "junit/echo", - null, null, true); - Response response = client.get("hello"); - assertTrue(response.getStatus() == 401); - } - - @Test - public void testHttpAuthClientProps() throws Exception { - logger.info("-- testHttpAuthClientProps() --"); - - Properties httpProperties = new Properties(); - - httpProperties.setProperty(PolicyProperties.PROPERTY_HTTP_SERVER_SERVICES, "PAP,PDP"); - httpProperties.setProperty - (PolicyProperties.PROPERTY_HTTP_SERVER_SERVICES + "." + "PAP" + PolicyProperties.PROPERTY_HTTP_HOST_SUFFIX, - "localhost"); - httpProperties.setProperty - (PolicyProperties.PROPERTY_HTTP_SERVER_SERVICES + "." + "PAP" + PolicyProperties.PROPERTY_HTTP_PORT_SUFFIX, - "7777"); - httpProperties.setProperty - (PolicyProperties.PROPERTY_HTTP_SERVER_SERVICES + "." + "PAP" + PolicyProperties.PROPERTY_HTTP_AUTH_USERNAME_SUFFIX, - "testpap"); - httpProperties.setProperty - (PolicyProperties.PROPERTY_HTTP_SERVER_SERVICES + "." + "PAP" + PolicyProperties.PROPERTY_HTTP_AUTH_PASSWORD_SUFFIX, - "alpha123"); - httpProperties.setProperty - (PolicyProperties.PROPERTY_HTTP_SERVER_SERVICES + "." + "PAP" + PolicyProperties.PROPERTY_HTTP_REST_CLASSES_SUFFIX, - RestMockHealthCheck.class.getName()); - httpProperties.setProperty - (PolicyProperties.PROPERTY_HTTP_CLIENT_SERVICES + "." + "PAP" + PolicyProperties.PROPERTY_MANAGED_SUFFIX, - "true"); - - httpProperties.setProperty - (PolicyProperties.PROPERTY_HTTP_SERVER_SERVICES + "." + "PDP" + PolicyProperties.PROPERTY_HTTP_HOST_SUFFIX, - "localhost"); - httpProperties.setProperty - (PolicyProperties.PROPERTY_HTTP_SERVER_SERVICES + "." + "PDP" + PolicyProperties.PROPERTY_HTTP_PORT_SUFFIX, - "7778"); - httpProperties.setProperty - (PolicyProperties.PROPERTY_HTTP_SERVER_SERVICES + "." + "PDP" + PolicyProperties.PROPERTY_HTTP_AUTH_USERNAME_SUFFIX, - "testpdp"); - httpProperties.setProperty - (PolicyProperties.PROPERTY_HTTP_SERVER_SERVICES + "." + "PDP" + PolicyProperties.PROPERTY_HTTP_AUTH_PASSWORD_SUFFIX, - "alpha123"); - httpProperties.setProperty - (PolicyProperties.PROPERTY_HTTP_SERVER_SERVICES + "." + "PDP" + PolicyProperties.PROPERTY_HTTP_REST_CLASSES_SUFFIX, - RestMockHealthCheck.class.getName()); - httpProperties.setProperty - (PolicyProperties.PROPERTY_HTTP_CLIENT_SERVICES + "." + "PAP" + PolicyProperties.PROPERTY_MANAGED_SUFFIX, - "true"); - - httpProperties.setProperty(PolicyProperties.PROPERTY_HTTP_CLIENT_SERVICES, "PAP,PDP"); - httpProperties.setProperty - (PolicyProperties.PROPERTY_HTTP_CLIENT_SERVICES + "." + "PAP" + PolicyProperties.PROPERTY_HTTP_HOST_SUFFIX, - "localhost"); - httpProperties.setProperty - (PolicyProperties.PROPERTY_HTTP_CLIENT_SERVICES + "." + "PAP" + PolicyProperties.PROPERTY_HTTP_PORT_SUFFIX, - "7777"); - httpProperties.setProperty - (PolicyProperties.PROPERTY_HTTP_CLIENT_SERVICES + "." + "PAP" + PolicyProperties.PROPERTY_HTTP_URL_SUFFIX, - "pap/test"); - httpProperties.setProperty - (PolicyProperties.PROPERTY_HTTP_CLIENT_SERVICES + "." + "PAP" + PolicyProperties.PROPERTY_HTTP_HTTPS_SUFFIX, - "false"); - httpProperties.setProperty - (PolicyProperties.PROPERTY_HTTP_CLIENT_SERVICES + "." + "PAP" + PolicyProperties.PROPERTY_HTTP_AUTH_USERNAME_SUFFIX, - "testpap"); - httpProperties.setProperty - (PolicyProperties.PROPERTY_HTTP_CLIENT_SERVICES + "." + "PAP" + PolicyProperties.PROPERTY_HTTP_AUTH_PASSWORD_SUFFIX, - "alpha123"); - httpProperties.setProperty - (PolicyProperties.PROPERTY_HTTP_CLIENT_SERVICES + "." + "PAP" + PolicyProperties.PROPERTY_MANAGED_SUFFIX, - "true"); - - httpProperties.setProperty - (PolicyProperties.PROPERTY_HTTP_CLIENT_SERVICES + "." + "PDP" + PolicyProperties.PROPERTY_HTTP_HOST_SUFFIX, - "localhost"); - httpProperties.setProperty - (PolicyProperties.PROPERTY_HTTP_CLIENT_SERVICES + "." + "PDP" + PolicyProperties.PROPERTY_HTTP_PORT_SUFFIX, - "7778"); - httpProperties.setProperty - (PolicyProperties.PROPERTY_HTTP_CLIENT_SERVICES + "." + "PDP" + PolicyProperties.PROPERTY_HTTP_URL_SUFFIX, - "pdp"); - httpProperties.setProperty - (PolicyProperties.PROPERTY_HTTP_CLIENT_SERVICES + "." + "PDP" + PolicyProperties.PROPERTY_HTTP_HTTPS_SUFFIX, - "false"); - httpProperties.setProperty - (PolicyProperties.PROPERTY_HTTP_CLIENT_SERVICES + "." + "PDP" + PolicyProperties.PROPERTY_HTTP_AUTH_USERNAME_SUFFIX, - "testpdp"); - httpProperties.setProperty - (PolicyProperties.PROPERTY_HTTP_CLIENT_SERVICES + "." + "PDP" + PolicyProperties.PROPERTY_HTTP_AUTH_PASSWORD_SUFFIX, - "alpha123"); - httpProperties.setProperty - (PolicyProperties.PROPERTY_HTTP_CLIENT_SERVICES + "." + "PDP" + PolicyProperties.PROPERTY_MANAGED_SUFFIX, - "true"); - - ArrayList<HttpServletServer> servers = HttpServletServer.factory.build(httpProperties); - assertTrue(servers.size() == 2); - - ArrayList<HttpClient> clients = HttpClient.factory.build(httpProperties); - assertTrue(clients.size() == 2); - - for (HttpServletServer server: servers) { - server.waitedStart(5000); - } - - HttpClient clientPAP = HttpClient.factory.get("PAP"); - Response response = clientPAP.get(); - assertTrue(response.getStatus() == 200); - - HttpClient clientPDP = HttpClient.factory.get("PDP"); - Response response2 = clientPDP.get("test"); - assertTrue(response2.getStatus() == 500); - } - - -} diff --git a/policy-endpoints/src/test/java/org/openecomp/policy/drools/http/server/test/HttpServerTest.java b/policy-endpoints/src/test/java/org/openecomp/policy/drools/http/server/test/HttpServerTest.java deleted file mode 100644 index 6be96320..00000000 --- a/policy-endpoints/src/test/java/org/openecomp/policy/drools/http/server/test/HttpServerTest.java +++ /dev/null @@ -1,207 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * policy-endpoints - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -package org.openecomp.policy.drools.http.server.test; - -import static org.junit.Assert.assertTrue; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; -import java.net.URL; -import java.util.UUID; - -import org.junit.Test; -import org.openecomp.policy.drools.http.server.HttpServletServer; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * HttpServletServer JUNIT tests - */ -public class HttpServerTest { - - /** - * Logger - */ - private static Logger logger = LoggerFactory.getLogger(HttpServerTest.class); - - @Test - public void testSingleServer() throws Exception { - logger.info("-- testSingleServer() --"); - - HttpServletServer server = HttpServletServer.factory.build("echo", "localhost", 5678, "/", false, true); - server.addServletPackage("/*", this.getClass().getPackage().getName()); - server.waitedStart(5000); - - assertTrue(HttpServletServer.factory.get(5678).isAlive()); - - String echo = "hello"; - URL url = new URL("http://localhost:5678/junit/echo/" + echo); - String response = response(url); - assertTrue(response.equals(echo)); - - String responseSwagger = null; - try { - URL urlSwagger = new URL("http://localhost:5678/swagger.json" + echo); - responseSwagger = response(urlSwagger); - } catch(IOException ioe) { - // Expected - } - - assertTrue(responseSwagger == null); - - assertTrue(HttpServletServer.factory.get(5678).isAlive()); - assertTrue(HttpServletServer.factory.inventory().size() == 1); - - HttpServletServer.factory.destroy(5678); - assertTrue(HttpServletServer.factory.inventory().size() == 0); - } - - @Test - public void testMultipleServers() throws Exception { - logger.info("-- testMultipleServers() --"); - - HttpServletServer server1 = HttpServletServer.factory.build("echo-1", "localhost", 5678, "/", true, true); - server1.addServletPackage("/*", this.getClass().getPackage().getName()); - server1.waitedStart(5000); - - HttpServletServer server2 = HttpServletServer.factory.build("echo-2", "localhost", 5679, "/", false, true); - server2.addServletPackage("/*", this.getClass().getPackage().getName()); - server2.waitedStart(5000); - - assertTrue(HttpServletServer.factory.get(5678).isAlive()); - assertTrue(HttpServletServer.factory.get(5679).isAlive()); - - String echo = "hello"; - - URL url1 = new URL("http://localhost:5678/junit/echo/" + echo); - String response1 = response(url1); - assertTrue(response1.equals(echo)); - - URL urlSwagger = new URL("http://localhost:5678/swagger.json"); - String responseSwagger = response(urlSwagger); - assertTrue(responseSwagger != null); - - URL url2 = new URL("http://localhost:5679/junit/echo/" + echo); - String response2 = response(url2); - assertTrue(response2.equals(echo)); - - String responseSwagger2 = null; - try { - URL urlSwagger2 = new URL("http://localhost:5679/swagger.json"); - responseSwagger2 = response(urlSwagger2); - } catch(IOException ioe) { - // Expected - } - assertTrue(responseSwagger2 == null); - - HttpServletServer.factory.destroy(); - assertTrue(HttpServletServer.factory.inventory().size() == 0); - } - - @Test - public void testMultiServicePackage() throws Exception { - logger.info("-- testMultiServicePackage() --"); - - String randomName = UUID.randomUUID().toString(); - - HttpServletServer server = HttpServletServer.factory.build(randomName, "localhost", 5678, "/", false, true); - server.addServletPackage("/*", this.getClass().getPackage().getName()); - server.waitedStart(5000); - - assertTrue(HttpServletServer.factory.get(5678).isAlive()); - - String echo = "hello"; - URL urlService1 = new URL("http://localhost:5678/junit/echo/" + echo); - String responseService1 = response(urlService1); - assertTrue(responseService1.equals(echo)); - - URL urlService2 = new URL("http://localhost:5678/junit/endpoints/http/servers"); - String responseService2 = response(urlService2); - assertTrue(responseService2.contains(randomName)); - - HttpServletServer.factory.destroy(); - assertTrue(HttpServletServer.factory.inventory().size() == 0); - } - - @Test - public void testServiceClass() throws Exception { - logger.info("-- testServiceClass() --"); - String randomName = UUID.randomUUID().toString(); - - HttpServletServer server = HttpServletServer.factory.build(randomName, "localhost", 5678, "/", false, true); - server.addServletClass("/*", RestEchoService.class.getCanonicalName()); - server.waitedStart(5000); - - assertTrue(HttpServletServer.factory.get(5678).isAlive()); - - String echo = "hello"; - URL urlService1 = new URL("http://localhost:5678/junit/echo/" + echo); - String responseService1 = response(urlService1); - assertTrue(responseService1.equals(echo)); - - HttpServletServer.factory.destroy(); - assertTrue(HttpServletServer.factory.inventory().size() == 0); - } - - @Test - public void testMultiServiceClass() throws Exception { - logger.info("-- testMultiServiceClass() --"); - - String randomName = UUID.randomUUID().toString(); - - HttpServletServer server = HttpServletServer.factory.build(randomName, "localhost", 5678, "/", false, true); - server.addServletClass("/*", RestEchoService.class.getCanonicalName()); - server.addServletClass("/*", RestEndpoints.class.getCanonicalName()); - server.waitedStart(5000); - - assertTrue(HttpServletServer.factory.get(5678).isAlive()); - - String echo = "hello"; - URL urlService1 = new URL("http://localhost:5678/junit/echo/" + echo); - String responseService1 = response(urlService1); - assertTrue(responseService1.equals(echo)); - - URL urlService2 = new URL("http://localhost:5678/junit/endpoints/http/servers"); - String responseService2 = response(urlService2); - assertTrue(responseService2.contains(randomName)); - - HttpServletServer.factory.destroy(); - assertTrue(HttpServletServer.factory.inventory().size() == 0); - } - - /** - * @param url - * @throws IOException - */ - protected String response(URL url) throws IOException { - BufferedReader ioReader = new BufferedReader(new InputStreamReader(url.openStream())); - String response = ""; - String line; - while ((line = ioReader.readLine()) != null) { - response += line; - } - ioReader.close(); - return response; - } - - - -} diff --git a/policy-endpoints/src/test/java/org/openecomp/policy/drools/http/server/test/NoopTopicTest.java b/policy-endpoints/src/test/java/org/openecomp/policy/drools/http/server/test/NoopTopicTest.java deleted file mode 100644 index 924c2a2c..00000000 --- a/policy-endpoints/src/test/java/org/openecomp/policy/drools/http/server/test/NoopTopicTest.java +++ /dev/null @@ -1,117 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * policy-endpoints - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -package org.openecomp.policy.drools.http.server.test; - -import static org.junit.Assert.assertTrue; - -import java.util.List; -import java.util.Properties; - -import org.junit.Test; -import org.openecomp.policy.drools.event.comm.Topic.CommInfrastructure; -import org.openecomp.policy.drools.event.comm.TopicEndpoint; -import org.openecomp.policy.drools.event.comm.TopicListener; -import org.openecomp.policy.drools.event.comm.TopicSink; -import org.openecomp.policy.drools.event.comm.bus.NoopTopicSink; -import org.openecomp.policy.drools.properties.PolicyProperties; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * NOOP Endpoint Tests - */ -public class NoopTopicTest implements TopicListener { - - /** - * Logger - */ - private static Logger logger = LoggerFactory.getLogger(NoopTopicTest.class); - - private final String topicName = "junit-noop"; - private final String outMessage = "blah"; - private String inMessage = null; - - @Test - public void testNoopEndpoint() { - logger.info("-- testNoopEndpoint() --"); - - Properties noopSinkProperties = new Properties(); - noopSinkProperties.put(PolicyProperties.PROPERTY_NOOP_SINK_TOPICS, topicName); - - List<? extends TopicSink> noopTopics = - TopicEndpoint.manager.addTopicSinks(noopSinkProperties); - - TopicSink sink = NoopTopicSink.factory.get(topicName); - - assertTrue(noopTopics.size() == 1); - assertTrue(noopTopics.size() == NoopTopicSink.factory.inventory().size()); - assertTrue(noopTopics.get(0) == sink); - assertTrue(sink == NoopTopicSink.factory.inventory().get(0)); - - assertTrue(!sink.isAlive()); - - boolean badState = false; - try{ - sink.send(outMessage); - } catch(IllegalStateException e) { - badState = true; - } - assertTrue(badState); - - sink.start(); - assertTrue(sink.isAlive()); - - sink.send(outMessage); - assertTrue(sink.getRecentEvents().length == 1); - assertTrue(sink.getRecentEvents()[0].equals(outMessage)); - assertTrue(this.inMessage == null); - - sink.register(this); - sink.send(this.outMessage); - assertTrue(outMessage.equals(this.inMessage)); - this.inMessage = null; - - sink.unregister(this); - sink.send(this.outMessage); - assertTrue(!outMessage.equals(this.inMessage)); - - sink.stop(); - try{ - sink.send(outMessage); - } catch(IllegalStateException e) { - badState = true; - } - assertTrue(badState); - - NoopTopicSink.factory.destroy(topicName); - assertTrue(NoopTopicSink.factory.inventory().size() == 0); - } - - @Override - public void onTopicEvent(CommInfrastructure commType, String topic, String event) { - if (commType != CommInfrastructure.NOOP) - return; - - if (topic == null || !topic.equals(topicName)) - return; - - this.inMessage = event; - } -} diff --git a/policy-endpoints/src/test/java/org/openecomp/policy/drools/http/server/test/RestEchoService.java b/policy-endpoints/src/test/java/org/openecomp/policy/drools/http/server/test/RestEchoService.java deleted file mode 100644 index c7e70069..00000000 --- a/policy-endpoints/src/test/java/org/openecomp/policy/drools/http/server/test/RestEchoService.java +++ /dev/null @@ -1,46 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * policy-endpoints - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.drools.http.server.test; - -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; - -@Api(value="echo") -@Path("/junit/echo") -public class RestEchoService { - - @GET - @Path("{word}") - @Produces(MediaType.TEXT_PLAIN) - @ApiOperation( - value="echoes back whatever received" - ) - public String echo(@PathParam("word") String word) { - return word; - } - -} diff --git a/policy-endpoints/src/test/java/org/openecomp/policy/drools/http/server/test/RestEndpoints.java b/policy-endpoints/src/test/java/org/openecomp/policy/drools/http/server/test/RestEndpoints.java deleted file mode 100644 index b944a1d6..00000000 --- a/policy-endpoints/src/test/java/org/openecomp/policy/drools/http/server/test/RestEndpoints.java +++ /dev/null @@ -1,45 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * policy-endpoints - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.drools.http.server.test; - -import java.util.List; - -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; - -import org.openecomp.policy.drools.http.server.HttpServletServer; - -@Path("/junit/endpoints") -public class RestEndpoints { - - @GET - @Path("http/servers") - @Produces(MediaType.TEXT_PLAIN) - public String httpServers() { - List<HttpServletServer> servers = - HttpServletServer.factory.inventory(); - return servers.toString(); - } - - -} diff --git a/policy-endpoints/src/test/java/org/openecomp/policy/drools/http/server/test/RestMockHealthCheck.java b/policy-endpoints/src/test/java/org/openecomp/policy/drools/http/server/test/RestMockHealthCheck.java deleted file mode 100644 index 2d1d9279..00000000 --- a/policy-endpoints/src/test/java/org/openecomp/policy/drools/http/server/test/RestMockHealthCheck.java +++ /dev/null @@ -1,48 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * policy-endpoints - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.drools.http.server.test; - -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.Response.Status; - -@Path("/") -public class RestMockHealthCheck { - - @GET - @Path("pap/test") - @Produces(MediaType.APPLICATION_JSON) - public Response papHealthCheck() { - return Response.status(Status.OK).entity("All Alive").build(); - } - - @GET - @Path("pdp/test") - @Produces(MediaType.APPLICATION_JSON) - public Response pdpHealthCheck() { - return Response.status(Status.INTERNAL_SERVER_ERROR).entity("At least some Dead").build(); - } - - -} |