use of com.seleniumtests.connectors.tms.squash.entities.TestPlanItemExecution in project seleniumRobot by bhecquet.
the class TestTestPlanItemExecution method testSetResult.
@Test(groups = { "ut" })
public void testSetResult() {
HttpRequestWithBody patchRequest = (HttpRequestWithBody) createServerMock("PATCH", "/executions/83", 200, "{" + " \"_type\" : \"execution\"," + " \"id\" : 83," + " \"execution_status\" : \"SUCCESS\"," + " \"comment\" : \"<p>the comment was modified...</p>\"," + " \"prerequisite\" : \"<p>... but the prerequisite was not</p>\"," + " \"custom_fields\" : [ {" + " \"code\" : \"TXT_STATUS\"," + " \"label\" : \"text\"," + " \"value\" : \"allright\"" + " }, {" + " \"code\" : \"TAGS_RELATED\"," + " \"label\" : \"see also\"," + " \"value\" : [ \"see this\", \"also that\" ]" + " } ]," + " \"test_case_custom_fields\" : [ {" + " \"code\" : \"TC_TEXT\"," + " \"label\" : \"test case cuf\"," + " \"value\" : \"I'm from the test case\"" + " }, {" + " \"code\" : \"TC_LABELS\"," + " \"label\" : \"labels\"," + " \"value\" : [ \"was\", \"not\", \"updated\" ]" + " } ]," + " \"_links\" : {" + " \"self\" : {" + " \"href\" : \"http://localhost:8080/api/rest/latest/executions/83\"" + " }," + " \"project\" : {" + " \"href\" : \"http://localhost:8080/api/rest/latest/projects/14\"" + " }," + " \"test_plan_item\" : {" + " \"href\" : \"http://localhost:8080/api/rest/latest/iteration-test-plan-items/1\"" + " }," + " \"execution-steps\" : {" + " \"href\" : \"http://localhost:8080/api/rest/latest/executions/83/execution-steps\"" + " }," + " \"attachments\" : {" + " \"href\" : \"http://localhost:8080/api/rest/latest/executions/83/attachments\"" + " }" + " }" + "}", "request");
TestPlanItemExecution execution = new TestPlanItemExecution("http://localhost:4321/executions/83", 83, "execution");
execution.setResult(ExecutionStatus.SUCCESS);
verify(patchRequest).body(new JSONObject("{\"_type\":\"execution\",\"execution_status\":\"SUCCESS\"}"));
}
Aggregations