IBM Worklight Adapter의 통합 테스트를위한 POC를 개발 중입니다. 그렇게하면 RESTAssured framework을 사용하고 있습니다. 보안 테스트가 적용된 어댑터가 있습니다. XML 코드 조각 : 내 테스트에서IBM Worklight Adapter와 보안 테스트의 통합 테스트
<procedure name="submitAuthentication" />
내가 SubmitAuthentication 어댑터를 호출하고있어 그때 getCatalog 어댑터를 호출 해요 : 인증의
<procedure name="getCatalog"
securityTest="SingleStepAuthAdapter-securityTest" />
나는 다른 어댑터가 있습니다. 이 오류 응답 다음 날 반환 :
런타임 : 자원 '시저 : SampleHttpAdapter.getCatalog'영역 'SingleStepAuthRealm'에서 인증 된 경우에만 액세스 할 수 해야합니다. 이 인증이 getCatalog의 내 요청에 지속되지 않는 것 같아 응답으로 당
public void testGetCatalog() { Response response = RestAssured.given().get(BASE_URL.concat("SampleHttpAdapter& procedure=submitAuthentication¶meters=[\"worklight\",\"worklight\"]")); String sessionid = response.getSessionId(); Cookie cookie1 = new Cookie.Builder("JSESSIONID", sessionid).build(); System.out.println("cookie value" + cookie1.getValue()); RequestSpecification spec_two = new RequestSpecBuilder().addCookie(cookie1) .setSessionId(sessionid).build(); Response catalog_response = RestAssured.given() .spec(spec_two) .get(BASE_URL.concat("SampleHttpAdapter&procedure=getCatalog¶meters=[]")); String catalog_json = catalog_response.asString(); System.out.println(catalog_json); }
:
다음은 내가 실행하고있어 테스트 케이스이다. 내가 어떻게 할 수 있니?