This is two testcases a) Status Code b) Location header
// Prepare data to be posted String xmlBody = "<orderData><orderType>BUY</orderType><quantity>44</quantity><symbol>YHO</symbol></orderData>"; String location = given() .body(xmlBody) .contentType(ContentType.XML).body(xmlBody) // a) test status code .expect().statusCode(307) .when() .post("/RestFullDayTrader/resources/pending_orders/100").getHeader("Location"); // b) test Location Header assertTrue(location.contains("pending_orders/100"));
No comments:
Post a Comment