Fix tests
This commit is contained in:
@@ -27,9 +27,9 @@ import org.springframework.mock.web.MockHttpServletResponse;
|
||||
import org.springframework.security.oauth2.server.authorization.context.AuthorizationServerContextHolder;
|
||||
import org.springframework.security.oauth2.server.authorization.context.TestAuthorizationServerContext;
|
||||
import org.springframework.security.oauth2.server.authorization.settings.AuthorizationServerSettings;
|
||||
import org.springframework.web.util.InvalidUrlException;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
|
||||
import static org.assertj.core.api.Assertions.assertThatThrownBy;
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
import static org.mockito.Mockito.mock;
|
||||
@@ -171,8 +171,8 @@ public class OidcProviderConfigurationEndpointFilterTests {
|
||||
MockHttpServletResponse response = new MockHttpServletResponse();
|
||||
FilterChain filterChain = mock(FilterChain.class);
|
||||
|
||||
assertThatIllegalArgumentException().isThrownBy(() -> this.filter.doFilter(request, response, filterChain))
|
||||
.withMessage("issuer must be a valid URL");
|
||||
assertThatThrownBy(() -> this.filter.doFilter(request, response, filterChain))
|
||||
.isInstanceOf(InvalidUrlException.class);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -27,9 +27,9 @@ import org.springframework.mock.web.MockHttpServletResponse;
|
||||
import org.springframework.security.oauth2.server.authorization.context.AuthorizationServerContextHolder;
|
||||
import org.springframework.security.oauth2.server.authorization.context.TestAuthorizationServerContext;
|
||||
import org.springframework.security.oauth2.server.authorization.settings.AuthorizationServerSettings;
|
||||
import org.springframework.web.util.InvalidUrlException;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
|
||||
import static org.assertj.core.api.Assertions.assertThatThrownBy;
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
import static org.mockito.Mockito.mock;
|
||||
@@ -161,8 +161,8 @@ public class OAuth2AuthorizationServerMetadataEndpointFilterTests {
|
||||
MockHttpServletResponse response = new MockHttpServletResponse();
|
||||
FilterChain filterChain = mock(FilterChain.class);
|
||||
|
||||
assertThatIllegalArgumentException().isThrownBy(() -> this.filter.doFilter(request, response, filterChain))
|
||||
.withMessage("issuer must be a valid URL");
|
||||
assertThatThrownBy(() -> this.filter.doFilter(request, response, filterChain))
|
||||
.isInstanceOf(InvalidUrlException.class);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ import static org.mockito.Mockito.verifyNoInteractions;
|
||||
*/
|
||||
public class OAuth2DeviceAuthorizationEndpointFilterTests {
|
||||
|
||||
private static final String ISSUER_URI = "https://provider.com";
|
||||
private static final String ISSUER_URI = "https://provider.com:8090";
|
||||
|
||||
private static final String REMOTE_ADDRESS = "remote-address";
|
||||
|
||||
@@ -417,7 +417,7 @@ public class OAuth2DeviceAuthorizationEndpointFilterTests {
|
||||
request.setRemoteAddr(REMOTE_ADDRESS);
|
||||
request.setScheme("https");
|
||||
request.setServerName("provider.com");
|
||||
request.setServerPort(-1);
|
||||
request.setServerPort(8090);
|
||||
return request;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user