From 42a8635cdea31f4111d7157ac66c4622ae6d3a6e Mon Sep 17 00:00:00 2001 From: Josh Cummings Date: Wed, 27 May 2020 15:59:51 -0600 Subject: [PATCH] Remove @MockBean ClientRegistrationRepository Fixes gh-8606 --- .../src/test/java/sample/web/OAuth2LoginControllerTests.java | 5 ----- .../src/test/java/sample/OAuth2WebClientControllerTests.java | 5 ----- .../RegisteredOAuth2AuthorizedClientControllerTests.java | 5 ----- .../src/test/java/sample/OAuth2WebClientControllerTests.java | 5 ----- .../RegisteredOAuth2AuthorizedClientControllerTests.java | 5 ----- 5 files changed, 25 deletions(-) diff --git a/samples/boot/oauth2login/src/test/java/sample/web/OAuth2LoginControllerTests.java b/samples/boot/oauth2login/src/test/java/sample/web/OAuth2LoginControllerTests.java index 6bd111691c..3779bb7ff8 100644 --- a/samples/boot/oauth2login/src/test/java/sample/web/OAuth2LoginControllerTests.java +++ b/samples/boot/oauth2login/src/test/java/sample/web/OAuth2LoginControllerTests.java @@ -23,9 +23,7 @@ import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; -import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.security.oauth2.client.registration.ClientRegistration; -import org.springframework.security.oauth2.client.registration.ClientRegistrationRepository; import org.springframework.security.oauth2.core.AuthorizationGrantType; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.web.servlet.MockMvc; @@ -46,9 +44,6 @@ public class OAuth2LoginControllerTests { @Autowired MockMvc mvc; - @MockBean - ClientRegistrationRepository clientRegistrationRepository; - @Test public void rootWhenAuthenticatedReturnsUserAndClient() throws Exception { this.mvc.perform(get("/").with(oauth2Login())) diff --git a/samples/boot/oauth2webclient-webflux/src/test/java/sample/OAuth2WebClientControllerTests.java b/samples/boot/oauth2webclient-webflux/src/test/java/sample/OAuth2WebClientControllerTests.java index fcfa298955..52445dd212 100644 --- a/samples/boot/oauth2webclient-webflux/src/test/java/sample/OAuth2WebClientControllerTests.java +++ b/samples/boot/oauth2webclient-webflux/src/test/java/sample/OAuth2WebClientControllerTests.java @@ -27,10 +27,8 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.reactive.AutoConfigureWebTestClient; import org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest; import org.springframework.boot.test.context.TestConfiguration; -import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Import; -import org.springframework.security.oauth2.client.registration.ReactiveClientRegistrationRepository; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.web.reactive.server.WebTestClient; import org.springframework.web.reactive.function.client.WebClient; @@ -48,9 +46,6 @@ public class OAuth2WebClientControllerTests { @Autowired private WebTestClient client; - @MockBean - ReactiveClientRegistrationRepository clientRegistrationRepository; - @AfterClass public static void shutdown() throws Exception { web.shutdown(); diff --git a/samples/boot/oauth2webclient-webflux/src/test/java/sample/RegisteredOAuth2AuthorizedClientControllerTests.java b/samples/boot/oauth2webclient-webflux/src/test/java/sample/RegisteredOAuth2AuthorizedClientControllerTests.java index 374947fa16..32fc9095b7 100644 --- a/samples/boot/oauth2webclient-webflux/src/test/java/sample/RegisteredOAuth2AuthorizedClientControllerTests.java +++ b/samples/boot/oauth2webclient-webflux/src/test/java/sample/RegisteredOAuth2AuthorizedClientControllerTests.java @@ -27,10 +27,8 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.reactive.AutoConfigureWebTestClient; import org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest; import org.springframework.boot.test.context.TestConfiguration; -import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Import; -import org.springframework.security.oauth2.client.registration.ReactiveClientRegistrationRepository; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.web.reactive.server.WebTestClient; import org.springframework.web.reactive.function.client.WebClient; @@ -48,9 +46,6 @@ public class RegisteredOAuth2AuthorizedClientControllerTests { @Autowired private WebTestClient client; - @MockBean - ReactiveClientRegistrationRepository clientRegistrationRepository; - @AfterClass public static void shutdown() throws Exception { web.shutdown(); diff --git a/samples/boot/oauth2webclient/src/test/java/sample/OAuth2WebClientControllerTests.java b/samples/boot/oauth2webclient/src/test/java/sample/OAuth2WebClientControllerTests.java index 28beeefafb..8829c00471 100644 --- a/samples/boot/oauth2webclient/src/test/java/sample/OAuth2WebClientControllerTests.java +++ b/samples/boot/oauth2webclient/src/test/java/sample/OAuth2WebClientControllerTests.java @@ -26,9 +26,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; import org.springframework.boot.test.context.TestConfiguration; -import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.context.annotation.Bean; -import org.springframework.security.oauth2.client.registration.ClientRegistrationRepository; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.web.servlet.MockMvc; import org.springframework.web.reactive.function.client.WebClient; @@ -47,9 +45,6 @@ public class OAuth2WebClientControllerTests { @Autowired private MockMvc mockMvc; - @MockBean - ClientRegistrationRepository clientRegistrationRepository; - @AfterClass public static void shutdown() throws Exception { web.shutdown(); diff --git a/samples/boot/oauth2webclient/src/test/java/sample/RegisteredOAuth2AuthorizedClientControllerTests.java b/samples/boot/oauth2webclient/src/test/java/sample/RegisteredOAuth2AuthorizedClientControllerTests.java index e98997d9b7..91e3a2ec91 100644 --- a/samples/boot/oauth2webclient/src/test/java/sample/RegisteredOAuth2AuthorizedClientControllerTests.java +++ b/samples/boot/oauth2webclient/src/test/java/sample/RegisteredOAuth2AuthorizedClientControllerTests.java @@ -26,9 +26,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; import org.springframework.boot.test.context.TestConfiguration; -import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.context.annotation.Bean; -import org.springframework.security.oauth2.client.registration.ClientRegistrationRepository; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.web.servlet.MockMvc; import org.springframework.web.reactive.function.client.WebClient; @@ -47,9 +45,6 @@ public class RegisteredOAuth2AuthorizedClientControllerTests { @Autowired private MockMvc mockMvc; - @MockBean - ClientRegistrationRepository clientRegistrationRepository; - @AfterClass public static void shutdown() throws Exception { web.shutdown();