|
@@ -1,5 +1,5 @@
|
|
|
/*
|
|
|
- * Copyright 2002-2021 the original author or authors.
|
|
|
+ * Copyright 2002-2022 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.
|
|
@@ -28,7 +28,6 @@ import org.springframework.mock.http.MockHttpInputMessage;
|
|
|
import org.springframework.mock.http.client.MockClientHttpResponse;
|
|
|
import org.springframework.security.oauth2.core.OAuth2AuthorizationException;
|
|
|
import org.springframework.security.oauth2.core.OAuth2Error;
|
|
|
-import org.springframework.web.client.UnknownHttpStatusCodeException;
|
|
|
|
|
|
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
|
|
import static org.mockito.ArgumentMatchers.any;
|
|
@@ -102,8 +101,9 @@ public class OAuth2ErrorResponseErrorHandlerTests {
|
|
|
@Test
|
|
|
public void handleErrorWhenErrorResponseWithInvalidStatusCodeThenHandled() {
|
|
|
CustomMockClientHttpResponse response = new CustomMockClientHttpResponse(new byte[0], 596);
|
|
|
- assertThatExceptionOfType(UnknownHttpStatusCodeException.class)
|
|
|
- .isThrownBy(() -> this.errorHandler.handleError(response)).withMessage("596 : [no body]");
|
|
|
+ assertThatExceptionOfType(IllegalArgumentException.class)
|
|
|
+ .isThrownBy(() -> this.errorHandler.handleError(response))
|
|
|
+ .withMessage("No matching constant for [596]");
|
|
|
}
|
|
|
|
|
|
private static final class CustomMockClientHttpResponse extends MockHttpInputMessage implements ClientHttpResponse {
|