aboutsummaryrefslogtreecommitdiff
path: root/id/server/idserverlib/src/test/java
diff options
context:
space:
mode:
authorThomas Lenz <tlenz@iaik.tugraz.at>2020-09-08 15:15:25 +0200
committerThomas Lenz <tlenz@iaik.tugraz.at>2020-09-08 15:15:25 +0200
commit4207d7d2da81b74a31b639bae9502593bee4bc3c (patch)
tree582b5b3a6b262491d323f73c55b7eb04e9217a00 /id/server/idserverlib/src/test/java
parentf14d7b14905c3a3cf313fa18fbc93c8f18730862 (diff)
downloadmoa-id-spss-4207d7d2da81b74a31b639bae9502593bee4bc3c.tar.gz
moa-id-spss-4207d7d2da81b74a31b639bae9502593bee4bc3c.tar.bz2
moa-id-spss-4207d7d2da81b74a31b639bae9502593bee4bc3c.zip
add additional jUnit tests
Diffstat (limited to 'id/server/idserverlib/src/test/java')
-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");