use of com.netflix.titus.grpc.protogen.Capacity in project titus-control-plane by Netflix.
the class JobSubmitAndControlNegativeTest method testServiceJobInvalidCapacity.
@Test(timeout = TEST_TIMEOUT_MS)
public void testServiceJobInvalidCapacity() {
Capacity badCapacity = Capacity.newBuilder().setMin(-2).setDesired(-3).setMax(-4).build();
submitBadJob(client, SERVICE_JOB_DESCR_BUILDER.setService(SERVICE_JOB_SPEC_BUILDER.setCapacity(badCapacity).build()).build(), "extensions.capacity", "extensions.capacity.desired", "extensions.capacity.max", "extensions.capacity.min");
}
use of com.netflix.titus.grpc.protogen.Capacity in project titus-control-plane by Netflix.
the class JobSubmitAndControlNegativeTest method testTooLargeServiceJob.
@Test(timeout = TEST_TIMEOUT_MS)
public void testTooLargeServiceJob() {
Capacity badCapacity = Capacity.newBuilder().setMin(1).setDesired(100).setMax(10_001).build();
submitBadJob(client, SERVICE_JOB_DESCR_BUILDER.setService(SERVICE_JOB_SPEC_BUILDER.setCapacity(badCapacity)).build(), "extensions.capacity");
}
use of com.netflix.titus.grpc.protogen.Capacity in project titus-control-plane by Netflix.
the class JobManagementSpringResourceTest method testSetInstances.
@Test
public void testSetInstances() throws Exception {
Capacity capacity = Capacity.newBuilder().setMin(1).setDesired(2).setMax(3).build();
JobCapacityUpdate forwardedRequest = JobCapacityUpdate.newBuilder().setJobId(JOB_ID_1).setCapacity(capacity).build();
when(jobServiceGatewayMock.updateJobCapacity(forwardedRequest, JUNIT_REST_CALL_METADATA)).thenReturn(Completable.complete());
SpringMockMvcUtil.doPut(mockMvc, String.format("/api/v3/jobs/%s/instances", JOB_ID_1), capacity);
verify(jobServiceGatewayMock, times(1)).updateJobCapacity(forwardedRequest, JUNIT_REST_CALL_METADATA);
}
Aggregations