@ -1,5 +1,5 @@
/ *
* Copyright 2012 - 20 19 the original author or authors .
* Copyright 2012 - 20 20 the original author or authors .
*
* Licensed under the Apache License , Version 2.0 ( the "License" ) ;
* you may not use this file except in compliance with the License .
@ -190,6 +190,16 @@ class OAuth2ResourceServerAutoConfigurationTests {
. hasMessageContaining ( "Public key location does not exist" ) ) ;
}
@Test
void autoConfigurationShouldFailIfAlgorithmIsInvalid ( ) {
this . contextRunner
. withPropertyValues (
"spring.security.oauth2.resourceserver.jwt.public-key-location=classpath:public-key-location" ,
"spring.security.oauth2.resourceserver.jwt.jws-algorithm=NOT_VALID" )
. run ( ( context ) - > assertThat ( context ) . hasFailed ( ) . getFailure ( )
. hasMessageContaining ( "signatureAlgorithm cannot be null" ) ) ;
}
@Test
void autoConfigurationWhenSetUriKeyLocationAndIssuerUriPresentShouldUseSetUri ( ) {
this . contextRunner