use of com.seleniumtests.connectors.tms.squash.entities.IterationTestPlanItem in project seleniumRobot by bhecquet.
the class TestIterationTestPlanItem method testCreateExecution.
@Test(groups = { "ut" })
public void testCreateExecution() {
HttpRequestWithBody postRequest = (HttpRequestWithBody) createServerMock("POST", "/iteration-test-plan-items/1/executions", 200, "{" + " \"_type\" : \"iteration\"," + " \"id\" : 22," + " \"name\" : \"new iteration\"," + " \"reference\" : \"NEW_IT\"," + " \"description\" : \"<p>A new iteration</p>\"," + " \"parent\" : {" + " \"_type\" : \"campaign\"," + " \"id\" : 2," + " \"name\" : \"parent campaign\"," + " \"_links\" : {" + " \"self\" : {" + " \"href\" : \"http://localhost:8080/api/rest/latest/campaigns/2\"" + " }" + " }" + " }," + " \"created_by\" : \"User-A\"," + " \"created_on\" : \"2017-04-07T10:00:00.000+0000\"," + " \"last_modified_by\" : \"User-B\"," + " \"last_modified_on\" : \"2017-04-15T10:00:00.000+0000\"," + " \"scheduled_start_date\" : \"2017-04-09T10:00:00.000+0000\"," + " \"scheduled_end_date\" : \"2017-04-14T10:00:00.000+0000\"," + " \"actual_start_date\" : \"2017-04-10T10:00:00.000+0000\"," + " \"actual_end_date\" : \"2017-04-15T10:00:00.000+0000\"," + " \"actual_start_auto\" : false," + " \"actual_end_auto\" : true," + " \"custom_fields\" : [ {" + " \"code\" : \"CUF\"," + " \"label\" : \"cuf\"," + " \"value\" : \"value\"" + " } ]," + " \"test_suites\" : [ ]," + " \"attachments\" : [ ]," + " \"_links\" : {" + " \"self\" : {" + " \"href\" : \"http://localhost:8080/api/rest/latest/iterations/22\"" + " }," + " \"project\" : {" + " \"href\" : \"http://localhost:8080/api/rest/latest/projects/4\"" + " }," + " \"campaign\" : {" + " \"href\" : \"http://localhost:8080/api/rest/latest/campaigns/2\"" + " }," + " \"test-suites\" : {" + " \"href\" : \"http://localhost:8080/api/rest/latest/iterations/22/test-suites\"" + " }," + " \"test-plan\" : {" + " \"href\" : \"http://localhost:8080/api/rest/latest/iterations/22/test-plan\"" + " }," + " \"attachments\" : {" + " \"href\" : \"http://localhost:8080/api/rest/latest/iterations/22/attachments\"" + " }" + " }" + "}", "request");
TestCase testCase = new TestCase(3, "http://localhost:8080/api/rest/latest/test-cases/3");
IterationTestPlanItem itpi = new IterationTestPlanItem("http://localhost:8080/api/rest/latest/iteration-test-plan-items/1", 1, testCase);
TestPlanItemExecution execution = itpi.createExecution();
Assert.assertEquals(execution.getId(), 22);
}
use of com.seleniumtests.connectors.tms.squash.entities.IterationTestPlanItem in project seleniumRobot by bhecquet.
the class TestIterationTestPlanItem method testCreateExecutionWithError.
@Test(groups = { "ut" }, expectedExceptions = ScenarioException.class)
public void testCreateExecutionWithError() {
HttpRequestWithBody postRequest = (HttpRequestWithBody) createServerMock("POST", "/iteration-test-plan-items/1/executions", 200, "{}", "request");
when(postRequest.asJson()).thenThrow(UnirestException.class);
TestCase testCase = new TestCase(3, "http://localhost:8080/api/rest/latest/test-cases/3");
IterationTestPlanItem itpi = new IterationTestPlanItem("http://localhost:8080/api/rest/latest/iteration-test-plan-items/1", 1, testCase);
TestPlanItemExecution execution = itpi.createExecution();
}
Aggregations