Update JwtDecoders tests

Issue gh-7860
This commit is contained in:
Josh Cummings 2020-02-25 13:33:20 -07:00
parent 431cd6000b
commit 283e451cad
No known key found for this signature in database
GPG Key ID: 49EF60DD7FF83443
2 changed files with 14 additions and 16 deletions

View File

@ -20,6 +20,10 @@ import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import okhttp3.HttpUrl;
import okhttp3.mockwebserver.Dispatcher;
import okhttp3.mockwebserver.MockResponse;
@ -33,11 +37,6 @@ import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.web.util.UriComponentsBuilder;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatCode;
@ -102,7 +101,7 @@ public class JwtDecodersTests {
JwtDecoder decoder = JwtDecoders.fromOidcIssuerLocation(this.issuer);
assertThatCode(() -> decoder.decode(ISSUER_MISMATCH))
.isInstanceOf(JwtValidationException.class)
.hasMessageContaining("This iss claim is not equal to the configured issuer");
.hasMessageContaining("The iss claim is not valid");
}
@Test
@ -111,7 +110,7 @@ public class JwtDecodersTests {
JwtDecoder decoder = JwtDecoders.fromIssuerLocation(this.issuer);
assertThatCode(() -> decoder.decode(ISSUER_MISMATCH))
.isInstanceOf(JwtValidationException.class)
.hasMessageContaining("This iss claim is not equal to the configured issuer");
.hasMessageContaining("The iss claim is not valid");
}
@Test
@ -120,7 +119,7 @@ public class JwtDecodersTests {
JwtDecoder decoder = JwtDecoders.fromIssuerLocation(this.issuer);
assertThatCode(() -> decoder.decode(ISSUER_MISMATCH))
.isInstanceOf(JwtValidationException.class)
.hasMessageContaining("This iss claim is not equal to the configured issuer");
.hasMessageContaining("The iss claim is not valid");
}
@Test

View File

@ -20,6 +20,10 @@ import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import okhttp3.HttpUrl;
import okhttp3.mockwebserver.Dispatcher;
import okhttp3.mockwebserver.MockResponse;
@ -33,11 +37,6 @@ import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.web.util.UriComponentsBuilder;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import static org.assertj.core.api.Assertions.assertThatCode;
/**
@ -104,7 +103,7 @@ public class ReactiveJwtDecodersTests {
assertThatCode(() -> decoder.decode(ISSUER_MISMATCH).block())
.isInstanceOf(JwtValidationException.class)
.hasMessageContaining("This iss claim is not equal to the configured issuer");
.hasMessageContaining("The iss claim is not valid");
}
@Test
@ -115,7 +114,7 @@ public class ReactiveJwtDecodersTests {
assertThatCode(() -> decoder.decode(ISSUER_MISMATCH).block())
.isInstanceOf(JwtValidationException.class)
.hasMessageContaining("This iss claim is not equal to the configured issuer");
.hasMessageContaining("The iss claim is not valid");
}
@Test
@ -126,7 +125,7 @@ public class ReactiveJwtDecodersTests {
assertThatCode(() -> decoder.decode(ISSUER_MISMATCH).block())
.isInstanceOf(JwtValidationException.class)
.hasMessageContaining("This iss claim is not equal to the configured issuer");
.hasMessageContaining("The iss claim is not valid");
}
@Test