aboutsummaryrefslogtreecommitdiff
path: root/id/server
diff options
context:
space:
mode:
Diffstat (limited to 'id/server')
-rw-r--r--id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/util/ParamValidatorUtilsTest.java30
1 files changed, 30 insertions, 0 deletions
diff --git a/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/util/ParamValidatorUtilsTest.java b/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/util/ParamValidatorUtilsTest.java
index 7afad55aa..d7cc2bd3a 100644
--- a/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/util/ParamValidatorUtilsTest.java
+++ b/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/util/ParamValidatorUtilsTest.java
@@ -171,6 +171,36 @@ public class ParamValidatorUtilsTest {
}
@Test
+ public void templateLazyWithUsernameFirst() {
+
+ HttpServletRequest req = getDummyHttpRequest("junit.com");
+ String template = "https://junit.com@https://wrong.com/cccc";
+ List<String> oaSlTemplates = Arrays.asList(
+ "http://aaaa.com/bbbb",
+ "https://aaaa.com/bbbb",
+ "file://aaaa.com/bbbb");
+
+ Assert.assertFalse("Template should be valid",
+ ParamValidatorUtils.isValidTemplate(req, template, oaSlTemplates, false));
+
+ }
+
+ @Test
+ public void templateLazyWithUsernameSecond() {
+
+ HttpServletRequest req = getDummyHttpRequest("junit.com");
+ String template = "https://junit.com@wrong.com/cccc";
+ List<String> oaSlTemplates = Arrays.asList(
+ "http://aaaa.com/bbbb",
+ "https://aaaa.com/bbbb",
+ "file://aaaa.com/bbbb");
+
+ Assert.assertFalse("Template should be valid",
+ ParamValidatorUtils.isValidTemplate(req, template, oaSlTemplates, false));
+
+ }
+
+ @Test
public void templateLazyWhitelistSeven() {
HttpServletRequest req = getDummyHttpRequest("junit.com");