aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-be/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'catalog-be/src/test')
-rw-r--r--catalog-be/src/test/java/org/openecomp/sdc/be/user/UserBusinessLogicTest.java23
1 files changed, 23 insertions, 0 deletions
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/user/UserBusinessLogicTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/user/UserBusinessLogicTest.java
index 3663076564..3fe8e03565 100644
--- a/catalog-be/src/test/java/org/openecomp/sdc/be/user/UserBusinessLogicTest.java
+++ b/catalog-be/src/test/java/org/openecomp/sdc/be/user/UserBusinessLogicTest.java
@@ -750,4 +750,27 @@ public class UserBusinessLogicTest {
ThreadLocalsHolder.setUserContext(originalUserContext);
}
}
+
+ @Test
+ public void testIsUserBase64EncodedTrueUserIdBase64Encoded() {
+ String userId = "bW9jaw==";
+ assertThat(testSubject.isUserBase64Encoded(userId)).isTrue();
+ }
+
+ @Test
+ public void testIsUserBase64EncodedFalseUserIdNotBase64Encoded() {
+ String userId = "mockId";
+ assertThat(testSubject.isUserBase64Encoded(userId)).isFalse();
+ }
+
+ @Test
+ public void testIsUserBase64EncodedFalseUserIdIsNull() {
+ assertThat(testSubject.isUserBase64Encoded(null)).isFalse();
+ }
+
+ @Test
+ public void testIsUserBase64EncodedFalseInvalidBase64Characters() {
+ String userId = "%not£valid*";
+ assertThat(testSubject.isUserBase64Encoded(userId)).isFalse();
+ }
}