Skip to content

Commit 6fddfad

Browse files
Heikki Kittmrts
authored andcommitted
test: Add origin unit tests
fix: README.md typo
1 parent b8ee372 commit 6fddfad

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
# Quickstart
88

9-
Complete the steps below to add support for secure authentication with eID cards to your Java web application back end. Instructions for the font end are available [here](https://github.com/web-eid/web-eid.js).
9+
Complete the steps below to add support for secure authentication with eID cards to your Java web application back end. Instructions for the front end are available [here](https://github.com/web-eid/web-eid.js).
1010

1111
A Java web application that uses Maven or Gradle to manage packages is needed for running this quickstart. Examples are for Maven, but they are straightforward to translate to Gradle.
1212

src/test/java/org/webeid/security/validator/OriginTest.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,4 +99,17 @@ void testTokenOriginNotHttps() throws Exception {
9999
.isInstanceOf(OriginMismatchException.class);
100100
}
101101

102+
@Test
103+
void testValidatorOriginNotValidUrl() {
104+
assertThatThrownBy(() -> getAuthTokenValidator("ria://ria.ee", cache))
105+
.isInstanceOf(IllegalArgumentException.class)
106+
.hasMessageStartingWith("Provided URI is not a valid URL");
107+
}
108+
109+
@Test
110+
void testValidatorOriginNotValidSyntax() {
111+
assertThatThrownBy(() -> getAuthTokenValidator("https:///ria.ee", cache))
112+
.isInstanceOf(IllegalArgumentException.class)
113+
.hasMessageStartingWith("An URI syntax exception occurred");
114+
}
102115
}

0 commit comments

Comments
 (0)