2
인증이 필요한 통합 테스트를하고 있습니다. 세션 상태 (즉, 쿠키)가 요청을 유지하지 않는 것처럼 보입니다. CookieManager 같은 것이 있습니까? 문제가 세션 상태를 잃는 것이 아니라 오히려 '금지 - URL이'처음부터 보안으로 지정되지 않을 수 있습니다처럼 내게 보이는Groovy HttpBuilder로 두 요청 사이의 세션 상태를 유지하는 방법
@Test
public void whenAuthenticatedUserRequestAForbiddenUrlShouldObtain403() {
def client = new RESTClient('http://127.0.0.1:8080/app/')
def login = client .post(
path: 'api/login.json',
body: [j_username: 'user', j_password: 'test'],
requestContentType: ContentType.URLENC)
def resp = client .get(path: 'forbidden-url')
assert (resp.status == 403)
==> FAILS status = 200
}