From 55f21cee67b36dd6352a775a50ef048a0ff35140 Mon Sep 17 00:00:00 2001 From: Eylon Malin Date: Thu, 24 Oct 2019 12:43:12 +0300 Subject: fix ApacheClientMetricInterceptor to return expected ResponseCode Issue-ID: VID-253 Signed-off-by: Eylon Malin Change-Id: I5c90f5bcbf34eee28c192128333ca940558ecb30 --- .../main/java/org/onap/vid/logging/ApacheClientMetricInterceptor.java | 2 +- .../java/org/onap/vid/logging/ApacheClientMetricInterceptorTest.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'vid-app-common/src') diff --git a/vid-app-common/src/main/java/org/onap/vid/logging/ApacheClientMetricInterceptor.java b/vid-app-common/src/main/java/org/onap/vid/logging/ApacheClientMetricInterceptor.java index f5b09501e..51e684456 100644 --- a/vid-app-common/src/main/java/org/onap/vid/logging/ApacheClientMetricInterceptor.java +++ b/vid-app-common/src/main/java/org/onap/vid/logging/ApacheClientMetricInterceptor.java @@ -51,7 +51,7 @@ public abstract class ApacheClientMetricInterceptor extends AbstractMetricLogFil @Override protected String getResponseCode(HttpResponse httpResponse) { - return httpResponse.getStatusLine().getReasonPhrase(); + return String.valueOf(httpResponse.getStatusLine().getStatusCode()); } @Override diff --git a/vid-app-common/src/test/java/org/onap/vid/logging/ApacheClientMetricInterceptorTest.java b/vid-app-common/src/test/java/org/onap/vid/logging/ApacheClientMetricInterceptorTest.java index 29f17b2e7..43f986501 100644 --- a/vid-app-common/src/test/java/org/onap/vid/logging/ApacheClientMetricInterceptorTest.java +++ b/vid-app-common/src/test/java/org/onap/vid/logging/ApacheClientMetricInterceptorTest.java @@ -67,7 +67,7 @@ public class ApacheClientMetricInterceptorTest { @Test public void testGetResponseCode() { - assertEquals(interceptor.getResponseCode(response), "ok"); + assertEquals(interceptor.getResponseCode(response), "200"); } @Test -- cgit 1.2.3-korg