use of com.yahoo.vespa.orchestrator.OrchestratorImpl in project vespa by vespa-engine.
the class HostResourceTest method throws_409_when_request_rejected_by_policies.
@Test
public void throws_409_when_request_rejected_by_policies() {
final OrchestratorImpl alwaysRejectResolver = new OrchestratorImpl(new AlwaysFailPolicy(), new ClusterControllerClientFactoryMock(), EVERY_HOST_IS_UP_HOST_STATUS_SERVICE, mockInstanceLookupService, SERVICE_MONITOR_CONVERGENCE_LATENCY_SECONDS);
try {
HostResource hostResource = new HostResource(alwaysRejectResolver, uriInfo);
hostResource.suspend("hostname");
fail();
} catch (WebApplicationException w) {
assertThat(w.getResponse().getStatus()).isEqualTo(409);
}
}
use of com.yahoo.vespa.orchestrator.OrchestratorImpl in project vespa by vespa-engine.
the class HostResourceTest method throws_409_when_request_rejected_by_policies_for_batch.
@Test
public void throws_409_when_request_rejected_by_policies_for_batch() {
final OrchestratorImpl alwaysRejectResolver = new OrchestratorImpl(new AlwaysFailPolicy(), new ClusterControllerClientFactoryMock(), EVERY_HOST_IS_UP_HOST_STATUS_SERVICE, mockInstanceLookupService, SERVICE_MONITOR_CONVERGENCE_LATENCY_SECONDS);
try {
HostSuspensionResource hostSuspensionResource = new HostSuspensionResource(alwaysRejectResolver);
hostSuspensionResource.suspendAll("parentHostname", Arrays.asList("hostname1", "hostname2"));
fail();
} catch (WebApplicationException w) {
assertThat(w.getResponse().getStatus()).isEqualTo(409);
}
}
Aggregations