0
REST Assured API를 사용하여 REST API를 자동화해야하지만 문제가 발생합니다. REST Assured API를 사용하여 스프링 보안 구성으로 로그인해야합니다.스프링 보안으로 Rest API에 로그인 할 수 없습니다.
@Before
public void configure() {
RestAssured.baseURI = "https://example.com";
RestAssured.basePath = "/my-portal";
}
@Test
public void apiLogin() {
given().auth().form("username", "password", springSecurity().withLoggingEnabled(new LogConfig())).when().get();
}
내가 직면하고 문제는 다음과 같습니다 :
실제 요청 URI : https://example.com/j_spring_security_check
예상 요청 URI :
https://example.com/my-portal/j_spring_security_check
다음은 가져온 응답입니다.
Request method: POST
Request URI: https://example.com/j_spring_security_check
Proxy: <none>
Request params: <none>
Query params: <none>
Form params: j_username={username}
j_password={password}
Path params: <none>
Multiparts: <none>
Headers: Accept=*/*
Content-Type=application/x-www-form-urlencoded; charset=ISO-8859-1
Cookies: <none>
Body: <none>
HTTP/1.1 404 Not Found
Date: Mon, 06 Feb 2017 10:51:41 GMT
Content-Length: 0
Connection: close
Content-Type: text/plain
아무도 답변을 드릴 수 있습니까? https://github.com/rest-assured/rest-assured/issues/815 – kartoos