diff options
Diffstat (limited to 'feature-healthcheck')
3 files changed, 11 insertions, 12 deletions
diff --git a/feature-healthcheck/src/main/feature/config/feature-healthcheck.properties b/feature-healthcheck/src/main/feature/config/feature-healthcheck.properties index fc03841a..70a010cd 100644 --- a/feature-healthcheck/src/main/feature/config/feature-healthcheck.properties +++ b/feature-healthcheck/src/main/feature/config/feature-healthcheck.properties @@ -28,4 +28,4 @@ http.server.services.HEALTHCHECK.userName=${env:HEALTHCHECK_USER} http.server.services.HEALTHCHECK.password=${env:HEALTHCHECK_PASSWORD} http.server.services.HEALTHCHECK.https=true http.server.services.HEALTHCHECK.aaf=${env:AAF} -http.server.services.HEALTHCHECK.serialization.provider=org.onap.policy.common.gson.JacksonHandler +http.server.services.HEALTHCHECK.serialization.provider=org.onap.policy.common.gson.JacksonHandler,org.onap.policy.common.endpoints.http.server.YamlJacksonHandler diff --git a/feature-healthcheck/src/main/java/org/onap/policy/drools/healthcheck/RestHealthCheck.java b/feature-healthcheck/src/main/java/org/onap/policy/drools/healthcheck/RestHealthCheck.java index 954a2c55..5d9d67ec 100644 --- a/feature-healthcheck/src/main/java/org/onap/policy/drools/healthcheck/RestHealthCheck.java +++ b/feature-healthcheck/src/main/java/org/onap/policy/drools/healthcheck/RestHealthCheck.java @@ -31,20 +31,20 @@ import javax.ws.rs.Path; 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.drools.healthcheck.HealthCheck.Reports; @Path("/") @Api -@Produces(MediaType.APPLICATION_JSON) +@Produces({MediaType.APPLICATION_JSON, YamlMessageBodyHandler.APPLICATION_YAML}) @SwaggerDefinition( info = @Info( description = "PDP-D Healthcheck Service", version = "v1.0", title = "PDP-D Healthcheck" ), - consumes = {MediaType.APPLICATION_JSON}, - produces = {MediaType.APPLICATION_JSON}, + consumes = {MediaType.APPLICATION_JSON, YamlMessageBodyHandler.APPLICATION_YAML}, + produces = {MediaType.APPLICATION_JSON, YamlMessageBodyHandler.APPLICATION_YAML}, schemes = {SwaggerDefinition.Scheme.HTTP}, tags = { @Tag(name = "pdp-d-healthcheck", description = "Drools PDP Healthcheck Operations") @@ -54,7 +54,6 @@ public class RestHealthCheck { @GET @Path("healthcheck") - @Produces(MediaType.APPLICATION_JSON) @ApiOperation( value = "Perform a system healthcheck", notes = "Provides healthy status of the PDP-D plus the components defined in its " @@ -67,7 +66,6 @@ public class RestHealthCheck { @GET @Path("healthcheck/configuration") - @Produces(MediaType.APPLICATION_JSON) @ApiOperation( value = "Configuration", notes = "Provides the Healthcheck server configuration and monitored REST clients", diff --git a/feature-healthcheck/src/test/java/org/onap/policy/drools/healthcheck/RestMockHealthCheck.java b/feature-healthcheck/src/test/java/org/onap/policy/drools/healthcheck/RestMockHealthCheck.java index 8bdad5b6..8cbe1fbf 100644 --- a/feature-healthcheck/src/test/java/org/onap/policy/drools/healthcheck/RestMockHealthCheck.java +++ b/feature-healthcheck/src/test/java/org/onap/policy/drools/healthcheck/RestMockHealthCheck.java @@ -7,9 +7,9 @@ * 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. @@ -26,14 +26,15 @@ import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import javax.ws.rs.core.Response.Status; +import org.onap.policy.common.endpoints.http.server.YamlMessageBodyHandler; @Path("/") public class RestMockHealthCheck { - + @GET @Path("healthcheck/test") - @Produces(MediaType.APPLICATION_JSON) - public Response papHealthCheck() { + @Produces({MediaType.APPLICATION_JSON, YamlMessageBodyHandler.APPLICATION_YAML}) + public Response papHealthCheck() { return Response.status(Status.OK).entity("All Alive").build(); } |