add swagger test
This commit is contained in:
parent
27c1ed3189
commit
46cc39ed23
|
@ -44,7 +44,7 @@ public class SecurityJavaConfig extends WebSecurityConfigurerAdapter {
|
||||||
.authorizeRequests()
|
.authorizeRequests()
|
||||||
.antMatchers("/api/csrfAttacker*").permitAll()
|
.antMatchers("/api/csrfAttacker*").permitAll()
|
||||||
.antMatchers("/api/customer/**").permitAll()
|
.antMatchers("/api/customer/**").permitAll()
|
||||||
.antMatchers("/api/**").authenticated()
|
.antMatchers("/api/foos/**").authenticated()
|
||||||
.and()
|
.and()
|
||||||
.formLogin()
|
.formLogin()
|
||||||
.successHandler(authenticationSuccessHandler)
|
.successHandler(authenticationSuccessHandler)
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
package org.baeldung.web;
|
||||||
|
|
||||||
|
import static org.junit.Assert.assertEquals;
|
||||||
|
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import com.jayway.restassured.RestAssured;
|
||||||
|
import com.jayway.restassured.response.Response;
|
||||||
|
|
||||||
|
public class SwaggerLiveTest {
|
||||||
|
private static final String URL_PREFIX = "http://localhost:8080/spring-security-rest/api";
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void whenVerifySpringFoxIsWorking_thenOK() {
|
||||||
|
final Response response = RestAssured.get(URL_PREFIX + "/v2/api-docs");
|
||||||
|
assertEquals(200, response.statusCode());
|
||||||
|
System.out.println(response.asString());
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue