Search in sources :

Example 6 with TestPlanItemExecution

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\"}"));
}
Also used : JSONObject(kong.unirest.json.JSONObject) HttpRequestWithBody(kong.unirest.HttpRequestWithBody) TestPlanItemExecution(com.seleniumtests.connectors.tms.squash.entities.TestPlanItemExecution) Test(org.testng.annotations.Test) ConnectorsTest(com.seleniumtests.ConnectorsTest) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest)

Aggregations

TestPlanItemExecution (com.seleniumtests.connectors.tms.squash.entities.TestPlanItemExecution)6 ConnectorsTest (com.seleniumtests.ConnectorsTest)5 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)5 Test (org.testng.annotations.Test)5 HttpRequestWithBody (kong.unirest.HttpRequestWithBody)3 IterationTestPlanItem (com.seleniumtests.connectors.tms.squash.entities.IterationTestPlanItem)2 TestCase (com.seleniumtests.connectors.tms.squash.entities.TestCase)2 JSONObject (kong.unirest.json.JSONObject)2 RequestBodyEntity (kong.unirest.RequestBodyEntity)1