spec.log().all();
public static Response sendHttpGet(String contentType, String httpGetCommand, boolean responseLog) { if (responseLog) { return given() .contentType(contentType) .log().all() .expect() .log().all() .when() .get(httpGetCommand); } return given() .contentType(contentType) .log().all() .when() .get(httpGetCommand); }
public static Response sendHttpGet(String contentType, String httpGetCommand, boolean responseLog) { if (responseLog) { return given() .contentType(contentType) .log().all() .expect() .log().all() .when() .get(httpGetCommand); } return given() .contentType(contentType) .log().all() .when() .get(httpGetCommand); }
@Test public void testVersion() { given().log().all() .get("q2/version").then().statusCode(200).assertThat() .body("version", equalTo( String.format("jPOS %s %s/%s (%s)", Q2.getVersion(), Q2.getBranch(), Q2.getRevision(), Q2.getBuildTimestamp() ) )); }
@Test public void testAll() { given().log().all() .get("q2").then().statusCode(200).assertThat() .body("version", equalTo( String.format("jPOS %s %s/%s (%s)", Q2.getVersion(), Q2.getBranch(), Q2.getRevision(), Q2.getBuildTimestamp() ) )); }
@Test public void testPost() { given().and().body("{ \"test\": \"Test JSON\" }") .log().all().post("q2") .then().statusCode(200).assertThat() .body("version", equalTo( String.format("jPOS %s %s/%s (%s)", Q2.getVersion(), Q2.getBranch(), Q2.getRevision(), Q2.getBuildTimestamp() ) )); }
public static Response sendHttpPost(String contentType, String payload, String httpPostCommand, boolean responseLog) { if (responseLog) { return given() .contentType(contentType) .body(payload) .log().all() .expect() .log().all() .when() .post(httpPostCommand); } return given() .contentType(contentType) .body(payload) // .log().all() .when() .post(httpPostCommand); }
public static Response sendHttpPost(String contentType, Map<String, ?> parameters, String httpPostCommand, boolean responseLog) { if (responseLog) { return given() .contentType(contentType) .formParameters(parameters) .log().all() .expect() .log().all() .when() .post(httpPostCommand); } return given() .contentType(contentType) .formParameters(parameters) // .log().all() .when() .post(httpPostCommand); }
public static Response sendHttpPost(String contentType, String payload, String httpPostCommand, boolean responseLog) { if (responseLog) { return given() .contentType(contentType) .body(payload) .log().all() .expect() .log().all() .when() .post(httpPostCommand); } return given() .contentType(contentType) .body(payload) // .log().all() .when() .post(httpPostCommand); }
public static Response sendHttpPost(String contentType, Map<String, ?> parameters, String httpPostCommand, boolean responseLog) { if (responseLog) { return given() .contentType(contentType) .formParameters(parameters) .log().all() .expect() .log().all() .when() .post(httpPostCommand); } return given() .contentType(contentType) .formParameters(parameters) // .log().all() .when() .post(httpPostCommand); }