Search in sources :

Example 1 with RollingUpdateRequest

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

the class DeploymentGroupResourceTest method testRollingUpdateDeploymentGroupDoesNotExist.

@Test
public void testRollingUpdateDeploymentGroupDoesNotExist() throws Exception {
    doThrow(new DeploymentGroupDoesNotExistException("")).when(model).rollingUpdate(any(DeploymentGroup.class), any(JobId.class), any(RolloutOptions.class));
    final Response response = resource.rollingUpdate("foo", new RollingUpdateRequest(new JobId("foo", "0.3", "1234"), RolloutOptions.newBuilder().build()));
    assertEquals(Response.Status.OK.getStatusCode(), response.getStatus());
    assertEquals(new RollingUpdateResponse(RollingUpdateResponse.Status.DEPLOYMENT_GROUP_NOT_FOUND), response.getEntity());
}
Also used : RolloutOptions(com.spotify.helios.common.descriptors.RolloutOptions) RemoveDeploymentGroupResponse(com.spotify.helios.common.protocol.RemoveDeploymentGroupResponse) RollingUpdateResponse(com.spotify.helios.common.protocol.RollingUpdateResponse) CreateDeploymentGroupResponse(com.spotify.helios.common.protocol.CreateDeploymentGroupResponse) Response(javax.ws.rs.core.Response) RollingUpdateRequest(com.spotify.helios.common.protocol.RollingUpdateRequest) DeploymentGroupDoesNotExistException(com.spotify.helios.master.DeploymentGroupDoesNotExistException) RollingUpdateResponse(com.spotify.helios.common.protocol.RollingUpdateResponse) DeploymentGroup(com.spotify.helios.common.descriptors.DeploymentGroup) JobId(com.spotify.helios.common.descriptors.JobId) Test(org.junit.Test)

Example 2 with RollingUpdateRequest

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

the class DeploymentGroupResourceTest method testRollingUpdateJobDoesNotExist.

@Test
public void testRollingUpdateJobDoesNotExist() throws Exception {
    doThrow(new JobDoesNotExistException("")).when(model).rollingUpdate(any(DeploymentGroup.class), any(JobId.class), any(RolloutOptions.class));
    final Response response = resource.rollingUpdate("foo", new RollingUpdateRequest(new JobId("foo", "0.3", "1234"), RolloutOptions.newBuilder().build()));
    assertEquals(Response.Status.OK.getStatusCode(), response.getStatus());
    assertEquals(new RollingUpdateResponse(RollingUpdateResponse.Status.JOB_NOT_FOUND), response.getEntity());
}
Also used : RolloutOptions(com.spotify.helios.common.descriptors.RolloutOptions) RemoveDeploymentGroupResponse(com.spotify.helios.common.protocol.RemoveDeploymentGroupResponse) RollingUpdateResponse(com.spotify.helios.common.protocol.RollingUpdateResponse) CreateDeploymentGroupResponse(com.spotify.helios.common.protocol.CreateDeploymentGroupResponse) Response(javax.ws.rs.core.Response) JobDoesNotExistException(com.spotify.helios.master.JobDoesNotExistException) RollingUpdateRequest(com.spotify.helios.common.protocol.RollingUpdateRequest) RollingUpdateResponse(com.spotify.helios.common.protocol.RollingUpdateResponse) DeploymentGroup(com.spotify.helios.common.descriptors.DeploymentGroup) JobId(com.spotify.helios.common.descriptors.JobId) Test(org.junit.Test)

Aggregations

DeploymentGroup (com.spotify.helios.common.descriptors.DeploymentGroup)2 JobId (com.spotify.helios.common.descriptors.JobId)2 RolloutOptions (com.spotify.helios.common.descriptors.RolloutOptions)2 CreateDeploymentGroupResponse (com.spotify.helios.common.protocol.CreateDeploymentGroupResponse)2 RemoveDeploymentGroupResponse (com.spotify.helios.common.protocol.RemoveDeploymentGroupResponse)2 RollingUpdateRequest (com.spotify.helios.common.protocol.RollingUpdateRequest)2 RollingUpdateResponse (com.spotify.helios.common.protocol.RollingUpdateResponse)2 Response (javax.ws.rs.core.Response)2 Test (org.junit.Test)2 DeploymentGroupDoesNotExistException (com.spotify.helios.master.DeploymentGroupDoesNotExistException)1 JobDoesNotExistException (com.spotify.helios.master.JobDoesNotExistException)1