File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
server/src/test/java/dev/findfirst/users/controller Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 11package dev .findfirst .users .controller ;
22
33import static dev .findfirst .utilities .HttpUtility .getHttpEntity ;
4+ import static org .junit .Assert .assertArrayEquals ;
45import static org .junit .Assert .assertNotNull ;
56import static org .junit .jupiter .api .Assertions .assertEquals ;
67import static org .junit .jupiter .api .Assertions .assertTrue ;
4849@ IntegrationTest
4950@ MockTypesense
5051@ SpringBootTest (webEnvironment = SpringBootTest .WebEnvironment .RANDOM_PORT )
51- @ TestPropertySource (locations = "classpath:application-test.yml" )
52+ @ TestPropertySource (locations = "classpath:application-test.yml" ,
53+ properties = {"spring.security.oauth2.client.registration.github.client-secret=secret-oauth" ,
54+ "spring.security.oauth2.client.registration.github.client-id=test-id" })
5255class UserControllerTest {
5356
5457 TestRestTemplate restTemplate = new TestRestTemplate ();
@@ -239,4 +242,12 @@ void testRemoveUserPhoto_Success() throws Exception {
239242
240243 assertEquals (HttpStatus .OK , response .getStatusCode ());
241244 }
245+
246+ @ Test
247+ void getAllProivders () {
248+ var response = restTemplate .getForEntity ("/user/oauth2Providers" , String [].class );
249+
250+ assertArrayEquals (new String [] {"github" }, response .getBody ());
251+
252+ }
242253}
You can’t perform that action at this time.
0 commit comments