Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jgrandja committed Aug 19, 2024
1 parent e2fca4c commit 82413f4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
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;
Expand Down Expand Up @@ -171,8 +171,8 @@ public void doFilterWhenAuthorizationServerSettingsWithInvalidIssuerThenThrowIll
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);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
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;
Expand Down Expand Up @@ -161,8 +161,8 @@ public void doFilterWhenAuthorizationServerSettingsWithInvalidIssuerThenThrowIll
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);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
*/
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";

Expand Down Expand Up @@ -417,7 +417,7 @@ private static MockHttpServletRequest createRequest() {
request.setRemoteAddr(REMOTE_ADDRESS);
request.setScheme("https");
request.setServerName("provider.com");
request.setServerPort(-1);
request.setServerPort(8090);
return request;
}

Expand Down

0 comments on commit 82413f4

Please sign in to comment.