summaryrefslogtreecommitdiffstats
path: root/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-spring
diff options
context:
space:
mode:
Diffstat (limited to 'openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-spring')
-rw-r--r--openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-spring/src/main/java/org/openecomp/sdc/logging/servlet/spring/LoggingInterceptor.java10
-rw-r--r--openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-spring/src/test/java/org/openecomp/sdc/logging/servlet/spring/LoggingInterceptorTest.java23
2 files changed, 16 insertions, 17 deletions
diff --git a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-spring/src/main/java/org/openecomp/sdc/logging/servlet/spring/LoggingInterceptor.java b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-spring/src/main/java/org/openecomp/sdc/logging/servlet/spring/LoggingInterceptor.java
index 7ee942a180..393a061987 100644
--- a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-spring/src/main/java/org/openecomp/sdc/logging/servlet/spring/LoggingInterceptor.java
+++ b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-spring/src/main/java/org/openecomp/sdc/logging/servlet/spring/LoggingInterceptor.java
@@ -16,17 +16,17 @@
package org.openecomp.sdc.logging.servlet.spring;
-import static org.openecomp.sdc.logging.api.StatusCode.COMPLETE;
-import static org.openecomp.sdc.logging.api.StatusCode.ERROR;
+import static org.onap.logging.ref.slf4j.ONAPLogConstants.ResponseStatus.*;
import static org.springframework.http.HttpStatus.Series.REDIRECTION;
import static org.springframework.http.HttpStatus.Series.SUCCESSFUL;
import java.util.Objects;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+
+import org.onap.logging.ref.slf4j.ONAPLogConstants.ResponseStatus;
import org.openecomp.sdc.logging.api.Logger;
import org.openecomp.sdc.logging.api.LoggerFactory;
-import org.openecomp.sdc.logging.api.StatusCode;
import org.openecomp.sdc.logging.servlet.AuditTracker;
import org.openecomp.sdc.logging.servlet.CombinedTracker;
import org.openecomp.sdc.logging.servlet.ContextTracker;
@@ -120,7 +120,7 @@ public class LoggingInterceptor extends HandlerInterceptorAdapter {
}
@Override
- public StatusCode getStatusCode() {
+ public ResponseStatus getStatusCode() {
return statusInfo.getStatusCode();
}
@@ -154,7 +154,7 @@ public class LoggingInterceptor extends HandlerInterceptorAdapter {
return reasonPhrase;
}
- private StatusCode getStatusCode() {
+ private ResponseStatus getStatusCode() {
return series.equals(SUCCESSFUL) || series.equals(REDIRECTION) ? COMPLETE : ERROR;
}
}
diff --git a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-spring/src/test/java/org/openecomp/sdc/logging/servlet/spring/LoggingInterceptorTest.java b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-spring/src/test/java/org/openecomp/sdc/logging/servlet/spring/LoggingInterceptorTest.java
index 406f8b6dbd..86a4318ec9 100644
--- a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-spring/src/test/java/org/openecomp/sdc/logging/servlet/spring/LoggingInterceptorTest.java
+++ b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-spring/src/test/java/org/openecomp/sdc/logging/servlet/spring/LoggingInterceptorTest.java
@@ -22,13 +22,12 @@ import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
-import static org.openecomp.sdc.logging.api.StatusCode.COMPLETE;
-import static org.openecomp.sdc.logging.api.StatusCode.ERROR;
import static org.openecomp.sdc.logging.servlet.spring.LoggingInterceptor.LOGGING_TRACKER_KEY;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.junit.Test;
+import org.onap.logging.ref.slf4j.ONAPLogConstants.ResponseStatus;
import org.openecomp.sdc.logging.servlet.HttpHeader;
import org.openecomp.sdc.logging.servlet.RequestProcessingResult;
import org.openecomp.sdc.logging.servlet.Tracker;
@@ -80,7 +79,7 @@ public class LoggingInterceptorTest {
final int status = 101;
LoggingInterceptor.ServletResponseResult result = new LoggingInterceptor.ServletResponseResult(status);
assertEquals(status, result.getStatus());
- assertEquals(ERROR, result.getStatusCode());
+ assertEquals(ResponseStatus.ERROR, result.getStatusCode());
}
@Test
@@ -88,7 +87,7 @@ public class LoggingInterceptorTest {
final int status = 404;
LoggingInterceptor.ServletResponseResult result = new LoggingInterceptor.ServletResponseResult(status);
assertEquals(status, result.getStatus());
- assertEquals(ERROR, result.getStatusCode());
+ assertEquals(ResponseStatus.ERROR, result.getStatusCode());
}
@Test
@@ -96,7 +95,7 @@ public class LoggingInterceptorTest {
final int status = 503;
LoggingInterceptor.ServletResponseResult result = new LoggingInterceptor.ServletResponseResult(status);
assertEquals(status, result.getStatus());
- assertEquals(ERROR, result.getStatusCode());
+ assertEquals(ResponseStatus.ERROR, result.getStatusCode());
}
@Test
@@ -104,7 +103,7 @@ public class LoggingInterceptorTest {
final int status = 204;
LoggingInterceptor.ServletResponseResult result = new LoggingInterceptor.ServletResponseResult(status);
assertEquals(status, result.getStatus());
- assertEquals(COMPLETE, result.getStatusCode());
+ assertEquals(ResponseStatus.COMPLETE, result.getStatusCode());
}
@Test
@@ -112,7 +111,7 @@ public class LoggingInterceptorTest {
final int status = 307;
LoggingInterceptor.ServletResponseResult result = new LoggingInterceptor.ServletResponseResult(status);
assertEquals(status, result.getStatus());
- assertEquals(COMPLETE, result.getStatusCode());
+ assertEquals(ResponseStatus.COMPLETE, result.getStatusCode());
}
@Test
@@ -120,7 +119,7 @@ public class LoggingInterceptorTest {
final int status = 133;
LoggingInterceptor.ServletResponseResult result = new LoggingInterceptor.ServletResponseResult(status);
assertEquals(status, result.getStatus());
- assertEquals(ERROR, result.getStatusCode());
+ assertEquals(ResponseStatus.ERROR, result.getStatusCode());
}
@Test
@@ -128,7 +127,7 @@ public class LoggingInterceptorTest {
final int status = 485;
LoggingInterceptor.ServletResponseResult result = new LoggingInterceptor.ServletResponseResult(status);
assertEquals(status, result.getStatus());
- assertEquals(ERROR, result.getStatusCode());
+ assertEquals(ResponseStatus.ERROR, result.getStatusCode());
}
@Test
@@ -136,7 +135,7 @@ public class LoggingInterceptorTest {
final int status = 547;
LoggingInterceptor.ServletResponseResult result = new LoggingInterceptor.ServletResponseResult(status);
assertEquals(status, result.getStatus());
- assertEquals(ERROR, result.getStatusCode());
+ assertEquals(ResponseStatus.ERROR, result.getStatusCode());
}
@Test
@@ -144,7 +143,7 @@ public class LoggingInterceptorTest {
final int status = 277;
LoggingInterceptor.ServletResponseResult result = new LoggingInterceptor.ServletResponseResult(status);
assertEquals(status, result.getStatus());
- assertEquals(COMPLETE, result.getStatusCode());
+ assertEquals(ResponseStatus.COMPLETE, result.getStatusCode());
}
@Test
@@ -152,6 +151,6 @@ public class LoggingInterceptorTest {
final int status = 364;
LoggingInterceptor.ServletResponseResult result = new LoggingInterceptor.ServletResponseResult(status);
assertEquals(status, result.getStatus());
- assertEquals(COMPLETE, result.getStatusCode());
+ assertEquals(ResponseStatus.COMPLETE, result.getStatusCode());
}
}