Search in sources :

Example 26 with JobDeployResponse

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

the class CliDeploymentTest method testDeployingNonexistantHostJson.

@Test
public void testDeployingNonexistantHostJson() throws Exception {
    startDefaultMaster();
    // Wait for master to come up
    Polling.await(LONG_WAIT_SECONDS, SECONDS, new Callable<String>() {

        @Override
        public String call() throws Exception {
            final String output = cli("masters");
            return output.contains(masterName()) ? output : null;
        }
    });
    // Create job
    final JobId jobId = createJob(testJobName, testJobVersion, BUSYBOX, IDLE_COMMAND);
    // Verify that deploying a job to a nonexistent host fails
    final String output = cli("deploy", "--json", jobId.toString(), BOGUS_HOST);
    final JobDeployResponse jobDeployResponse = Json.read(output, JobDeployResponse.class);
    assertEquals(JobDeployResponse.Status.HOST_NOT_FOUND, jobDeployResponse.getStatus());
}
Also used : Matchers.containsString(org.hamcrest.Matchers.containsString) JobDeployResponse(com.spotify.helios.common.protocol.JobDeployResponse) JobId(com.spotify.helios.common.descriptors.JobId) Test(org.junit.Test)

Aggregations

JobDeployResponse (com.spotify.helios.common.protocol.JobDeployResponse)26 Deployment (com.spotify.helios.common.descriptors.Deployment)18 Test (org.junit.Test)18 JobId (com.spotify.helios.common.descriptors.JobId)16 CreateJobResponse (com.spotify.helios.common.protocol.CreateJobResponse)16 Job (com.spotify.helios.common.descriptors.Job)11 HeliosClient (com.spotify.helios.client.HeliosClient)10 TaskStatus (com.spotify.helios.common.descriptors.TaskStatus)8 DockerClient (com.spotify.docker.client.DockerClient)6 AgentMain (com.spotify.helios.agent.AgentMain)4 JobUndeployResponse (com.spotify.helios.common.protocol.JobUndeployResponse)4 Matchers.containsString (org.hamcrest.Matchers.containsString)4 HostStatus (com.spotify.helios.common.descriptors.HostStatus)3 JobDeleteResponse (com.spotify.helios.common.protocol.JobDeleteResponse)3 Container (com.spotify.docker.client.messages.Container)2 HostConfig (com.spotify.docker.client.messages.HostConfig)2 HostDeregisterResponse (com.spotify.helios.common.protocol.HostDeregisterResponse)2 Integer.toHexString (java.lang.Integer.toHexString)2 List (java.util.List)2 ExceptionMetered (com.codahale.metrics.annotation.ExceptionMetered)1