Remove @MockBean ClientRegistrationRepository
Fixes gh-8606
This commit is contained in:
parent
d5b8981678
commit
42a8635cde
|
@ -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()))
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue