Ibm mobilefirst IBM worklight适配器与安全测试的集成测试
我正在开发一个用于IBM worklight适配器集成测试的POC。在这样做的过程中,我正在使用。我有一个应用了安全测试的适配器。 XML代码段:Ibm mobilefirst IBM worklight适配器与安全测试的集成测试,ibm-mobilefirst,worklight-adapters,rest-assured,Ibm Mobilefirst,Worklight Adapters,Rest Assured,我正在开发一个用于IBM worklight适配器集成测试的POC。在这样做的过程中,我正在使用。我有一个应用了安全测试的适配器。 XML代码段: <procedure name="getCatalog" securityTest="SingleStepAuthAdapter-securityTest" /> 根据响应,身份验证似乎没有持续存在于我的getCatalog请求中。如何才能做到这一点?如果不知道适配器过程是如何编写的,则很难调查上述问题。你能包括提交认证的适配器程序
<procedure name="getCatalog"
securityTest="SingleStepAuthAdapter-securityTest" />
根据响应,身份验证似乎没有持续存在于我的getCatalog请求中。如何才能做到这一点?如果不知道适配器过程是如何编写的,则很难调查上述问题。你能包括提交认证的适配器程序以及getCatalog吗 我可以为您提供一个关于基于适配器的身份验证的示例和教程Worklight proivides,它将非常详细地描述身份验证过程是如何工作的。您甚至可以将此项目用作基础,因为它完成了一步适配器身份验证。使用它提供的身份验证机制,并将其添加到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);
}