diff options
Diffstat (limited to 'security-util-lib/src/test/java/org/onap')
17 files changed, 58 insertions, 60 deletions
diff --git a/security-util-lib/src/test/java/org/onap/sdc/security/AuthenticationCookieUtilsTest.java b/security-util-lib/src/test/java/org/onap/sdc/security/AuthenticationCookieUtilsTest.java index 900afe2..0460a90 100644 --- a/security-util-lib/src/test/java/org/onap/sdc/security/AuthenticationCookieUtilsTest.java +++ b/security-util-lib/src/test/java/org/onap/sdc/security/AuthenticationCookieUtilsTest.java @@ -20,8 +20,8 @@ package org.onap.sdc.security; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.io.IOException; import java.util.concurrent.TimeUnit; diff --git a/security-util-lib/src/test/java/org/onap/sdc/security/CipherUtilTest.java b/security-util-lib/src/test/java/org/onap/sdc/security/CipherUtilTest.java index e8d57a1..379bbea 100644 --- a/security-util-lib/src/test/java/org/onap/sdc/security/CipherUtilTest.java +++ b/security-util-lib/src/test/java/org/onap/sdc/security/CipherUtilTest.java @@ -20,8 +20,8 @@ package org.onap.sdc.security; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; import static org.junit.jupiter.api.Assertions.assertThrows; import org.apache.commons.codec.binary.Base64; diff --git a/security-util-lib/src/test/java/org/onap/sdc/security/PasswordsTest.java b/security-util-lib/src/test/java/org/onap/sdc/security/PasswordsTest.java index ff5d0f1..a390275 100644 --- a/security-util-lib/src/test/java/org/onap/sdc/security/PasswordsTest.java +++ b/security-util-lib/src/test/java/org/onap/sdc/security/PasswordsTest.java @@ -20,10 +20,10 @@ package org.onap.sdc.security; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotEquals; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; import org.junit.jupiter.api.Test; diff --git a/security-util-lib/src/test/java/org/onap/sdc/security/RepresentationUtilsTest.java b/security-util-lib/src/test/java/org/onap/sdc/security/RepresentationUtilsTest.java index a5a37d7..0ae2e2c 100644 --- a/security-util-lib/src/test/java/org/onap/sdc/security/RepresentationUtilsTest.java +++ b/security-util-lib/src/test/java/org/onap/sdc/security/RepresentationUtilsTest.java @@ -20,7 +20,7 @@ package org.onap.sdc.security; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.io.IOException; import java.util.HashSet; diff --git a/security-util-lib/src/test/java/org/onap/sdc/security/RestUtilsTest.java b/security-util-lib/src/test/java/org/onap/sdc/security/RestUtilsTest.java index a55b45d..82adc59 100644 --- a/security-util-lib/src/test/java/org/onap/sdc/security/RestUtilsTest.java +++ b/security-util-lib/src/test/java/org/onap/sdc/security/RestUtilsTest.java @@ -20,10 +20,10 @@ package org.onap.sdc.security; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.Properties; import org.apache.http.HttpHeaders; diff --git a/security-util-lib/src/test/java/org/onap/sdc/security/SecurityUtilTest.java b/security-util-lib/src/test/java/org/onap/sdc/security/SecurityUtilTest.java index 67361a9..6176355 100644 --- a/security-util-lib/src/test/java/org/onap/sdc/security/SecurityUtilTest.java +++ b/security-util-lib/src/test/java/org/onap/sdc/security/SecurityUtilTest.java @@ -20,8 +20,8 @@ package org.onap.sdc.security; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; import java.util.Base64; import org.junit.jupiter.api.Test; diff --git a/security-util-lib/src/test/java/org/onap/sdc/security/filters/RestrictionAccessFilterTest.java b/security-util-lib/src/test/java/org/onap/sdc/security/filters/RestrictionAccessFilterTest.java index 6fe7926..9e17340 100644 --- a/security-util-lib/src/test/java/org/onap/sdc/security/filters/RestrictionAccessFilterTest.java +++ b/security-util-lib/src/test/java/org/onap/sdc/security/filters/RestrictionAccessFilterTest.java @@ -20,9 +20,9 @@ package org.onap.sdc.security.filters; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.mockito.Mockito.spy; import static org.mockito.Mockito.when; @@ -61,7 +61,7 @@ public class RestrictionAccessFilterTest { } private void mockCreateFilter(ISessionValidationFilterConfiguration sessionConfig, - IUsersThreadLocalHolder threadLocalUtils, PortalClient portalClient) { + IUsersThreadLocalHolder threadLocalUtils, PortalClient portalClient) { filter = new RestrictionAccessFilter(sessionConfig, threadLocalUtils, portalClient); } @@ -209,5 +209,4 @@ public class RestrictionAccessFilterTest { ); } - } diff --git a/security-util-lib/src/test/java/org/onap/sdc/security/filters/SessionValidationFilterTest.java b/security-util-lib/src/test/java/org/onap/sdc/security/filters/SessionValidationFilterTest.java index c92d086..413fe00 100644 --- a/security-util-lib/src/test/java/org/onap/sdc/security/filters/SessionValidationFilterTest.java +++ b/security-util-lib/src/test/java/org/onap/sdc/security/filters/SessionValidationFilterTest.java @@ -30,20 +30,19 @@ import javax.servlet.ServletException; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import org.junit.FixMethodOrder; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.MethodOrderer; import org.junit.jupiter.api.Test; -import org.junit.runners.MethodSorters; +import org.junit.jupiter.api.TestMethodOrder; import org.mockito.Mockito; import org.onap.sdc.security.AuthenticationCookie; import org.onap.sdc.security.AuthenticationCookieUtils; import org.onap.sdc.security.CipherUtilException; import org.onap.sdc.security.RepresentationUtils; -@FixMethodOrder(MethodSorters.NAME_ASCENDING) +@TestMethodOrder(MethodOrderer.Alphanumeric.class) public class SessionValidationFilterTest { - private final HttpServletRequest request = Mockito.mock(HttpServletRequest.class); private final HttpServletResponse response = Mockito.spy(HttpServletResponse.class); @@ -247,4 +246,4 @@ public class SessionValidationFilterTest { sessionValidationFilter.setSecurityKey(oldKey); } -}
\ No newline at end of file +} diff --git a/security-util-lib/src/test/java/org/onap/sdc/security/logging/elements/LogFieldsMdcHandlerTest.java b/security-util-lib/src/test/java/org/onap/sdc/security/logging/elements/LogFieldsMdcHandlerTest.java index ea1f6b7..fe5a366 100644 --- a/security-util-lib/src/test/java/org/onap/sdc/security/logging/elements/LogFieldsMdcHandlerTest.java +++ b/security-util-lib/src/test/java/org/onap/sdc/security/logging/elements/LogFieldsMdcHandlerTest.java @@ -14,10 +14,10 @@ */ package org.onap.sdc.security.logging.elements; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.any; import static org.mockito.Mockito.anyInt; import static org.mockito.Mockito.anyString; diff --git a/security-util-lib/src/test/java/org/onap/sdc/security/logging/enums/EcompLoggerErrorCodeTest.java b/security-util-lib/src/test/java/org/onap/sdc/security/logging/enums/EcompLoggerErrorCodeTest.java index 2522c11..0a4eb4d 100644 --- a/security-util-lib/src/test/java/org/onap/sdc/security/logging/enums/EcompLoggerErrorCodeTest.java +++ b/security-util-lib/src/test/java/org/onap/sdc/security/logging/enums/EcompLoggerErrorCodeTest.java @@ -23,7 +23,7 @@ package org.onap.sdc.security.logging.enums; -import org.junit.Assert; +import static org.junit.jupiter.api.Assertions.assertEquals; import org.junit.jupiter.api.Test; public class EcompLoggerErrorCodeTest { @@ -32,19 +32,19 @@ public class EcompLoggerErrorCodeTest { public void getByValueTest() { EcompLoggerErrorCode ecompLoggerErrorCode = EcompLoggerErrorCode.getByValue("E_0"); - Assert.assertEquals(0, ecompLoggerErrorCode.getErrorCode()); + assertEquals(0, ecompLoggerErrorCode.getErrorCode()); ecompLoggerErrorCode = EcompLoggerErrorCode.getByValue("E_100"); - Assert.assertEquals(100, ecompLoggerErrorCode.getErrorCode()); + assertEquals(100, ecompLoggerErrorCode.getErrorCode()); ecompLoggerErrorCode = EcompLoggerErrorCode.getByValue("E_200"); - Assert.assertEquals(200, ecompLoggerErrorCode.getErrorCode()); + assertEquals(200, ecompLoggerErrorCode.getErrorCode()); ecompLoggerErrorCode = EcompLoggerErrorCode.getByValue("E_300"); - Assert.assertEquals(300, ecompLoggerErrorCode.getErrorCode()); + assertEquals(300, ecompLoggerErrorCode.getErrorCode()); ecompLoggerErrorCode = EcompLoggerErrorCode.getByValue("E_400"); - Assert.assertEquals(400, ecompLoggerErrorCode.getErrorCode()); + assertEquals(400, ecompLoggerErrorCode.getErrorCode()); ecompLoggerErrorCode = EcompLoggerErrorCode.getByValue("E_500"); - Assert.assertEquals(500, ecompLoggerErrorCode.getErrorCode()); + assertEquals(500, ecompLoggerErrorCode.getErrorCode()); ecompLoggerErrorCode = EcompLoggerErrorCode.getByValue("none"); - Assert.assertEquals(900, ecompLoggerErrorCode.getErrorCode()); + assertEquals(900, ecompLoggerErrorCode.getErrorCode()); } diff --git a/security-util-lib/src/test/java/org/onap/sdc/security/logging/enums/LoggerSupportabilityActionsTest.java b/security-util-lib/src/test/java/org/onap/sdc/security/logging/enums/LoggerSupportabilityActionsTest.java index b36ad72..0cbc34d 100644 --- a/security-util-lib/src/test/java/org/onap/sdc/security/logging/enums/LoggerSupportabilityActionsTest.java +++ b/security-util-lib/src/test/java/org/onap/sdc/security/logging/enums/LoggerSupportabilityActionsTest.java @@ -21,7 +21,7 @@ */ package org.onap.sdc.security.logging.enums; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import org.junit.jupiter.api.Test; diff --git a/security-util-lib/src/test/java/org/onap/sdc/security/logging/enums/SeverityTest.java b/security-util-lib/src/test/java/org/onap/sdc/security/logging/enums/SeverityTest.java index dff7665..23926cb 100644 --- a/security-util-lib/src/test/java/org/onap/sdc/security/logging/enums/SeverityTest.java +++ b/security-util-lib/src/test/java/org/onap/sdc/security/logging/enums/SeverityTest.java @@ -22,7 +22,7 @@ package org.onap.sdc.security.logging.enums; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import org.junit.jupiter.api.Test; diff --git a/security-util-lib/src/test/java/org/onap/sdc/security/logging/enums/StatusCodeTest.java b/security-util-lib/src/test/java/org/onap/sdc/security/logging/enums/StatusCodeTest.java index 1fefec5..225e8b1 100644 --- a/security-util-lib/src/test/java/org/onap/sdc/security/logging/enums/StatusCodeTest.java +++ b/security-util-lib/src/test/java/org/onap/sdc/security/logging/enums/StatusCodeTest.java @@ -22,7 +22,7 @@ package org.onap.sdc.security.logging.enums; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import org.junit.jupiter.api.Test; diff --git a/security-util-lib/src/test/java/org/onap/sdc/security/logging/wrappers/LoggerSdcAuditTest.java b/security-util-lib/src/test/java/org/onap/sdc/security/logging/wrappers/LoggerSdcAuditTest.java index 67412b4..091cda5 100644 --- a/security-util-lib/src/test/java/org/onap/sdc/security/logging/wrappers/LoggerSdcAuditTest.java +++ b/security-util-lib/src/test/java/org/onap/sdc/security/logging/wrappers/LoggerSdcAuditTest.java @@ -14,9 +14,9 @@ */ package org.onap.sdc.security.logging.wrappers; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.any; import static org.mockito.Mockito.anyString; import static org.mockito.Mockito.mock; diff --git a/security-util-lib/src/test/java/org/onap/sdc/security/logging/wrappers/LoggerSdcUtilBaseTest.java b/security-util-lib/src/test/java/org/onap/sdc/security/logging/wrappers/LoggerSdcUtilBaseTest.java index 7c16999..e764550 100644 --- a/security-util-lib/src/test/java/org/onap/sdc/security/logging/wrappers/LoggerSdcUtilBaseTest.java +++ b/security-util-lib/src/test/java/org/onap/sdc/security/logging/wrappers/LoggerSdcUtilBaseTest.java @@ -14,10 +14,10 @@ */ package org.onap.sdc.security.logging.wrappers; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyInt; import static org.mockito.ArgumentMatchers.anyList; diff --git a/security-util-lib/src/test/java/org/onap/sdc/security/logging/wrappers/LoggerTest.java b/security-util-lib/src/test/java/org/onap/sdc/security/logging/wrappers/LoggerTest.java index 0912920..731bf5e 100644 --- a/security-util-lib/src/test/java/org/onap/sdc/security/logging/wrappers/LoggerTest.java +++ b/security-util-lib/src/test/java/org/onap/sdc/security/logging/wrappers/LoggerTest.java @@ -14,10 +14,10 @@ */ package org.onap.sdc.security.logging.wrappers; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.any; import static org.mockito.Mockito.anyCollection; import static org.mockito.Mockito.anyString; @@ -59,7 +59,7 @@ public class LoggerTest { @Test public void isDebugEnabled() { - assertTrue("Debug level not enabled", log.isDebugEnabled()); + assertTrue(log.isDebugEnabled(),"Debug level not enabled"); } @Test @@ -69,23 +69,23 @@ public class LoggerTest { @Test public void isTraceEnabled() { - assertFalse("Trace level should not enabled", spy.isTraceEnabled()); + assertFalse(spy.isTraceEnabled(),"Trace level should be enabled"); } @Test public void isErrorEnabled() { - assertTrue("Error level is not enabled", spy.isErrorEnabled()); + assertTrue(spy.isErrorEnabled(),"Error level is not enabled"); } @Test public void isWarnEnabled() { - assertTrue("Warn level is not enabled", spy.isWarnEnabled()); + assertTrue(spy.isWarnEnabled(),"Warn level is not enabled"); } @Test public void isInfoEnabled() { - assertTrue("Info level is not enabled", spy.isInfoEnabled()); + assertTrue(spy.isInfoEnabled(), "Info level is not enabled"); } @Test @@ -399,4 +399,4 @@ public class LoggerTest { anyString(), any(ErrorLogOptionalData.class), anyString(), anyCollection(), anyCollection(), anyCollection()); } -}
\ No newline at end of file +} diff --git a/security-util-lib/src/test/java/org/onap/sdc/security/util/SecurityLogsUtilsTest.java b/security-util-lib/src/test/java/org/onap/sdc/security/util/SecurityLogsUtilsTest.java index b05dc64..3763ecf 100644 --- a/security-util-lib/src/test/java/org/onap/sdc/security/util/SecurityLogsUtilsTest.java +++ b/security-util-lib/src/test/java/org/onap/sdc/security/util/SecurityLogsUtilsTest.java @@ -22,13 +22,13 @@ package org.onap.sdc.security.util; -import org.junit.Test; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.onap.sdc.security.utils.SecurityLogsUtils.PORTAL_TARGET_ENTITY; + +import org.junit.jupiter.api.Test; import org.onap.sdc.security.logging.elements.ErrorLogOptionalData; import org.onap.sdc.security.utils.SecurityLogsUtils; -import static org.junit.Assert.assertNotNull; -import static org.onap.sdc.security.utils.SecurityLogsUtils.PORTAL_TARGET_ENTITY; - public class SecurityLogsUtilsTest { @Test |