Search in sources :

Example 11 with DeploymentGroupStatusResponse

use of com.spotify.helios.common.protocol.DeploymentGroupStatusResponse in project helios by spotify.

the class DeploymentGroupTest method testStopDeploymentGroup.

@Test
public void testStopDeploymentGroup() throws Exception {
    cli("create-deployment-group", "--json", TEST_GROUP, "foo=bar", "baz=qux");
    cli("create", "my_job:2", "my_image");
    assertThat(cli("stop-deployment-group", TEST_GROUP), containsString("Deployment-group my_group stopped"));
    final DeploymentGroupStatusResponse status = Json.read(cli("deployment-group-status", "--json", TEST_GROUP), DeploymentGroupStatusResponse.class);
    assertEquals(DeploymentGroupStatusResponse.Status.FAILED, status.getStatus());
    assertEquals("Stopped by user", status.getError());
}
Also used : DeploymentGroupStatusResponse(com.spotify.helios.common.protocol.DeploymentGroupStatusResponse) Test(org.junit.Test)

Aggregations

DeploymentGroupStatusResponse (com.spotify.helios.common.protocol.DeploymentGroupStatusResponse)11 Test (org.junit.Test)7 CoreMatchers.containsString (org.hamcrest.CoreMatchers.containsString)5 Matchers.anyString (org.mockito.Matchers.anyString)5 JobId (com.spotify.helios.common.descriptors.JobId)4 TaskStatus (com.spotify.helios.common.descriptors.TaskStatus)3 DeploymentGroup (com.spotify.helios.common.descriptors.DeploymentGroup)2 RolloutOptions (com.spotify.helios.common.descriptors.RolloutOptions)2 RollingUpdateResponse (com.spotify.helios.common.protocol.RollingUpdateResponse)2 Map (java.util.Map)2 ExceptionMetered (com.codahale.metrics.annotation.ExceptionMetered)1 Timed (com.codahale.metrics.annotation.Timed)1 Deployment (com.spotify.helios.common.descriptors.Deployment)1 DeploymentGroupStatus (com.spotify.helios.common.descriptors.DeploymentGroupStatus)1 HostSelector (com.spotify.helios.common.descriptors.HostSelector)1 HostStatus (com.spotify.helios.common.descriptors.HostStatus)1 DeploymentGroupDoesNotExistException (com.spotify.helios.master.DeploymentGroupDoesNotExistException)1 GET (javax.ws.rs.GET)1 Path (javax.ws.rs.Path)1 Produces (javax.ws.rs.Produces)1