Search in sources :

Example 1 with Capacity

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");
}
Also used : Capacity(com.netflix.titus.grpc.protogen.Capacity) BaseIntegrationTest(com.netflix.titus.master.integration.BaseIntegrationTest) IntegrationTest(com.netflix.titus.testkit.junit.category.IntegrationTest) Test(org.junit.Test)

Example 2 with Capacity

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");
}
Also used : Capacity(com.netflix.titus.grpc.protogen.Capacity) BaseIntegrationTest(com.netflix.titus.master.integration.BaseIntegrationTest) IntegrationTest(com.netflix.titus.testkit.junit.category.IntegrationTest) Test(org.junit.Test)

Example 3 with 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);
}
Also used : JobCapacityUpdate(com.netflix.titus.grpc.protogen.JobCapacityUpdate) Capacity(com.netflix.titus.grpc.protogen.Capacity) WebMvcTest(org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest) Test(org.junit.Test)

Aggregations

Capacity (com.netflix.titus.grpc.protogen.Capacity)3 Test (org.junit.Test)3 BaseIntegrationTest (com.netflix.titus.master.integration.BaseIntegrationTest)2 IntegrationTest (com.netflix.titus.testkit.junit.category.IntegrationTest)2 JobCapacityUpdate (com.netflix.titus.grpc.protogen.JobCapacityUpdate)1 WebMvcTest (org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest)1