Search in sources :

Example 6 with TestCase

use of com.seleniumtests.connectors.tms.squash.entities.TestCase in project seleniumRobot by bhecquet.

the class TestIterationTestPlanItem method testCreateIterationTestPlanItemWithError.

@Test(groups = { "ut" }, expectedExceptions = ScenarioException.class)
public void testCreateIterationTestPlanItemWithError() {
    RequestBodyEntity postRequest = (RequestBodyEntity) createServerMock("POST", "/iterations/4/test-plan", 200, "{}", "requestBodyEntity");
    when(postRequest.asJson()).thenThrow(UnirestException.class);
    Iteration iteration = new Iteration("http://localhost:8080/api/rest/latest/iterations/4", 4, "my_iteration");
    IterationTestPlanItem.create(iteration, new TestCase(25, "http://localhost:8080/api/rest/latest/test-cases/25"));
}
Also used : TestCase(com.seleniumtests.connectors.tms.squash.entities.TestCase) RequestBodyEntity(kong.unirest.RequestBodyEntity) Iteration(com.seleniumtests.connectors.tms.squash.entities.Iteration) Test(org.testng.annotations.Test) ConnectorsTest(com.seleniumtests.ConnectorsTest) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest)

Aggregations

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