aboutsummaryrefslogtreecommitdiffstats
path: root/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-spring/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-spring/src/test')
-rw-r--r--openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-spring/src/test/java/org/openecomp/sdc/logging/servlet/spring/LoggingInterceptorTest.java40
1 files changed, 40 insertions, 0 deletions
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 ccd0b70552..1aba519c7b 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
@@ -114,4 +114,44 @@ public class LoggingInterceptorTest {
assertEquals(status, result.getStatus());
assertEquals(COMPLETE, result.getStatusCode());
}
+
+ @Test
+ public void errorStatusWhenNonStandardInformationalCode() {
+ final int status = 133;
+ LoggingInterceptor.ServletResponseResult result = new LoggingInterceptor.ServletResponseResult(status);
+ assertEquals(status, result.getStatus());
+ assertEquals(ERROR, result.getStatusCode());
+ }
+
+ @Test
+ public void errorStatusWhenNonStandardClientErrorCode() {
+ final int status = 485;
+ LoggingInterceptor.ServletResponseResult result = new LoggingInterceptor.ServletResponseResult(status);
+ assertEquals(status, result.getStatus());
+ assertEquals(ERROR, result.getStatusCode());
+ }
+
+ @Test
+ public void errorStatusWhenNonStandardServerErrorCode() {
+ final int status = 547;
+ LoggingInterceptor.ServletResponseResult result = new LoggingInterceptor.ServletResponseResult(status);
+ assertEquals(status, result.getStatus());
+ assertEquals(ERROR, result.getStatusCode());
+ }
+
+ @Test
+ public void completeStatusWhenNonStandardSuccessCode() {
+ final int status = 277;
+ LoggingInterceptor.ServletResponseResult result = new LoggingInterceptor.ServletResponseResult(status);
+ assertEquals(status, result.getStatus());
+ assertEquals(COMPLETE, result.getStatusCode());
+ }
+
+ @Test
+ public void completeStatusWhenNonStandardRedirectionCode() {
+ final int status = 364;
+ LoggingInterceptor.ServletResponseResult result = new LoggingInterceptor.ServletResponseResult(status);
+ assertEquals(status, result.getStatus());
+ assertEquals(COMPLETE, result.getStatusCode());
+ }
} \ No newline at end of file