use of com.spotify.helios.common.protocol.RemoveDeploymentGroupResponse in project helios by spotify.
the class DeploymentGroupRemoveCommandTest method testRemoveDeploymentGroupRemovedJson.
@Test
public void testRemoveDeploymentGroupRemovedJson() throws Exception {
when(client.removeDeploymentGroup(GROUP_NAME)).thenReturn(immediateFuture(new RemoveDeploymentGroupResponse(Status.REMOVED)));
final int ret = command.run(options, client, out, true, null);
final String output = baos.toString();
verify(client).removeDeploymentGroup(GROUP_NAME);
assertEquals(0, ret);
final RemoveDeploymentGroupResponse res = Json.read(output, new TypeReference<RemoveDeploymentGroupResponse>() {
});
assertEquals(new RemoveDeploymentGroupResponse(Status.REMOVED), res);
}
use of com.spotify.helios.common.protocol.RemoveDeploymentGroupResponse in project helios by spotify.
the class DeploymentGroupResourceTest method testRemoveNonExistingDeploymentGroup.
@Test
public void testRemoveNonExistingDeploymentGroup() throws Exception {
doThrow(new DeploymentGroupDoesNotExistException("")).when(model).removeDeploymentGroup(anyString());
final Response response = resource.removeDeploymentGroup("foo");
assertEquals(Response.Status.OK.getStatusCode(), response.getStatus());
assertEquals(new RemoveDeploymentGroupResponse(RemoveDeploymentGroupResponse.Status.DEPLOYMENT_GROUP_NOT_FOUND), response.getEntity());
}
Aggregations