|
@@ -33,6 +33,7 @@ import java.util.HashMap;
|
|
|
import java.util.Map;
|
|
|
|
|
|
import static org.assertj.core.api.Assertions.assertThat;
|
|
|
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
|
|
|
|
|
|
/**
|
|
|
* @author Rob Winch
|
|
@@ -60,6 +61,21 @@ public class OidcIdTokenValidatorTests {
|
|
|
assertThat(this.validateIdToken()).isEmpty();
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ @Test
|
|
|
+ public void setClockSkewWhenNullThenThrowIllegalArgumentException() {
|
|
|
+ OidcIdTokenValidator idTokenValidator = new OidcIdTokenValidator(this.registration.build());
|
|
|
+ assertThatThrownBy(() -> idTokenValidator.setClockSkew(null))
|
|
|
+ .isInstanceOf(IllegalArgumentException.class);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Test
|
|
|
+ public void setClockSkewWhenNegativeSecondsThenThrowIllegalArgumentException() {
|
|
|
+ OidcIdTokenValidator idTokenValidator = new OidcIdTokenValidator(this.registration.build());
|
|
|
+ assertThatThrownBy(() -> idTokenValidator.setClockSkew(Duration.ofSeconds(-1)))
|
|
|
+ .isInstanceOf(IllegalArgumentException.class);
|
|
|
+ }
|
|
|
+
|
|
|
@Test
|
|
|
public void validateWhenIssuerNullThenHasErrors() {
|
|
|
this.claims.remove(IdTokenClaimNames.ISS);
|