@Test
public void testSetCapacityWithOptionalAttributes() throws Exception {

    JobCapacityWithOptionalAttributes restRequest = JobCapacityWithOptionalAttributes.newBuilder()
            .setMin(UInt32Value.newBuilder().setValue(1).build())
            .setDesired(UInt32Value.newBuilder().setValue(2).build())
            .setMax(UInt32Value.newBuilder().setValue(3).build())
            .build();
    JobCapacityUpdateWithOptionalAttributes forwardedRequest = JobCapacityUpdateWithOptionalAttributes.newBuilder()
            .setJobId(JOB_ID_1)
            .setJobCapacityWithOptionalAttributes(restRequest)
            .build();
    when(jobServiceGatewayMock.updateJobCapacityWithOptionalAttributes(forwardedRequest, JUNIT_REST_CALL_METADATA)).thenReturn(Completable.complete());
    SpringMockMvcUtil.doPut(mockMvc, String.format("/api/v3/jobs/%s/capacityAttributes", JOB_ID_1), restRequest);
    verify(jobServiceGatewayMock, times(1)).updateJobCapacityWithOptionalAttributes(forwardedRequest, JUNIT_REST_CALL_METADATA);
}