Search in sources :

Example 11 with Iteration

use of com.seleniumtests.connectors.tms.squash.entities.Iteration 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

Iteration (com.seleniumtests.connectors.tms.squash.entities.Iteration)11 Test (org.testng.annotations.Test)10 ConnectorsTest (com.seleniumtests.ConnectorsTest)9 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)9 IterationTestPlanItem (com.seleniumtests.connectors.tms.squash.entities.IterationTestPlanItem)5 Campaign (com.seleniumtests.connectors.tms.squash.entities.Campaign)4 SquashTMApi (com.seleniumtests.connectors.tms.squash.SquashTMApi)2 TestCase (com.seleniumtests.connectors.tms.squash.entities.TestCase)2 GetRequest (kong.unirest.GetRequest)2 HttpResponse (kong.unirest.HttpResponse)2 JSONObject (kong.unirest.json.JSONObject)2 GenericTest (com.seleniumtests.GenericTest)1 SquashTMConnector (com.seleniumtests.connectors.tms.squash.SquashTMConnector)1 ConfigurationException (com.seleniumtests.customexception.ConfigurationException)1 HttpRequestWithBody (kong.unirest.HttpRequestWithBody)1 RequestBodyEntity (kong.unirest.RequestBodyEntity)1