use of com.coveros.selenified.services.Request in project selenified by Coveros.
the class HTTPTest method buildStringSingleParamTest.
@Test
public void buildStringSingleParamTest() {
HTTP http = new HTTP(null, "Service");
Map<String, Object> params = new HashMap<>();
params.put("hello", "world");
assertEquals(http.getRequestParams(new Request().setUrlParams(params)), "?hello=world");
}
use of com.coveros.selenified.services.Request in project selenified by Coveros.
the class HTTPTest method buildStringEmptyParamTest.
@Test
public void buildStringEmptyParamTest() {
HTTP http = new HTTP(null, "Service");
assertEquals(http.getRequestParams(new Request()), "");
}
use of com.coveros.selenified.services.Request in project selenified by Coveros.
the class HTTPTest method buildStringMultipleParamsTest.
@Test
public void buildStringMultipleParamsTest() {
HTTP http = new HTTP(null, "Service");
Map<String, Object> params = new HashMap<>();
params.put("hello", "world");
params.put("john", 5);
assertEquals(http.getRequestParams(new Request().setUrlParams(params)), "?john=5&hello=world");
}
use of com.coveros.selenified.services.Request in project selenified by Coveros.
the class ReporterTest method outputRequestPropertiesJsonObjectTest.
@Test
public void outputRequestPropertiesJsonObjectTest() {
JsonObject json = new JsonObject();
json.addProperty("hello", "world");
Request request = new Request().setJsonPayload(json);
String requestPayloadOutput = Reporter.getRequestPayloadOutput(request, null);
assertTrue(requestPayloadOutput.matches("<a href='javascript:void\\(0\\)' onclick='toggle\\(\"[0-9]{13}_[a-zA-Z0-9]{10}\"\\)'>Toggle Payload</a> <span id='[0-9]{13}_[a-zA-Z0-9]{10}' style='display:none;'><div>\\{<br/> \"hello\": \"world\"<br/>\\}</div></span>"));
}
use of com.coveros.selenified.services.Request in project selenified by Coveros.
the class ReporterTest method outputRequestPropertiesEmptyMultipartAndFileTest.
@Test
public void outputRequestPropertiesEmptyMultipartAndFileTest() {
Request request = new Request().setMultipartData(new HashMap<>());
String requestPayloadOutput = Reporter.getRequestPayloadOutput(request, new File("Jenkinsfile"));
assertTrue(requestPayloadOutput.matches("<a href='javascript:void\\(0\\)' onclick='toggle\\(\"[0-9]{13}_[a-zA-Z0-9]{10}\"\\)'>Toggle Payload</a> <span id='[0-9]{13}_[a-zA-Z0-9]{10}' style='display:none;'><div> with file: <a href='file:///" + System.getProperty("user.dir").replace("\\", "\\\\") + File.separator.replace("\\", "\\\\") + "Jenkinsfile'>Jenkinsfile</a></div></span>"));
}
Aggregations