Browse Source

unit test checking

pull/4/head
shengzhaoli.shengz 1 year ago
parent
commit
0ddd620b89
  1. 5
      src/test/java/com/monkeyk/sos/web/controller/resource/UnityControllerTest.java

5
src/test/java/com/monkeyk/sos/web/controller/resource/UnityControllerTest.java

@ -17,6 +17,7 @@ import org.springframework.restdocs.RestDocumentationExtension;
import org.springframework.security.crypto.password.PasswordEncoder; import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.security.oauth2.server.authorization.OAuth2AuthorizationConsentService; import org.springframework.security.oauth2.server.authorization.OAuth2AuthorizationConsentService;
import org.springframework.security.oauth2.server.authorization.client.RegisteredClientRepository; import org.springframework.security.oauth2.server.authorization.client.RegisteredClientRepository;
import org.springframework.security.oauth2.server.authorization.settings.AuthorizationServerSettings;
import org.springframework.test.context.junit.jupiter.SpringExtension; import org.springframework.test.context.junit.jupiter.SpringExtension;
import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder; import org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder;
@ -65,6 +66,10 @@ class UnityControllerTest {
private PasswordEncoder passwordEncoder; private PasswordEncoder passwordEncoder;
@MockBean
private AuthorizationServerSettings authorizationServerSettings;
@BeforeEach @BeforeEach
public void setup(WebApplicationContext applicationContext, RestDocumentationContextProvider contextProvider) { public void setup(WebApplicationContext applicationContext, RestDocumentationContextProvider contextProvider) {
this.mockMvc = MockMvcBuilders.webAppContextSetup(applicationContext) this.mockMvc = MockMvcBuilders.webAppContextSetup(applicationContext)

Loading…
Cancel
Save