Search in sources :

Example 11 with Project

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

the class TestProject method testGetCampaignsInProjectWithError.

@Test(groups = { "ut" }, expectedExceptions = ScenarioException.class)
public void testGetCampaignsInProjectWithError() {
    GetRequest getRequest = (GetRequest) createServerMock("GET", "/projects/44/campaigns", 200, "{}", "request");
    when(getRequest.asPaged(any(), (Function<HttpResponse<JsonNode>, String>) any(Function.class))).thenThrow(UnirestException.class);
    Project project = new Project("http://localhost:4321/projects/44", 44, "project");
    List<Campaign> campaigns = project.getCampaigns();
}
Also used : Project(com.seleniumtests.connectors.tms.squash.entities.Project) Campaign(com.seleniumtests.connectors.tms.squash.entities.Campaign) GetRequest(kong.unirest.GetRequest) HttpResponse(kong.unirest.HttpResponse) Test(org.testng.annotations.Test) ConnectorsTest(com.seleniumtests.ConnectorsTest) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest)

Aggregations

Project (com.seleniumtests.connectors.tms.squash.entities.Project)11 ConnectorsTest (com.seleniumtests.ConnectorsTest)6 Test (org.testng.annotations.Test)6 JSONObject (kong.unirest.json.JSONObject)4 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)4 BeforeMethod (org.testng.annotations.BeforeMethod)4 Campaign (com.seleniumtests.connectors.tms.squash.entities.Campaign)3 CampaignFolder (com.seleniumtests.connectors.tms.squash.entities.CampaignFolder)3 GetRequest (kong.unirest.GetRequest)2 HttpResponse (kong.unirest.HttpResponse)1