@Test
public void testValidateJobIsService() throws Exception {

    when(jobOperations.getJob(JOB_ID)).thenReturn(Optional.of(Job.<BatchJobExt>newBuilder()
            .withId(JOB_ID)
            .withStatus(JobStatus.newBuilder()
                    .withState(JobState.Accepted)
                    .build())
            .withJobDescriptor(JobDescriptor.<BatchJobExt>newBuilder()
                    .build())
            .build()));
    Throwable thrown = catchThrowable(() -> loadBalancerValidator.validateJobId(JOB_ID));
    assertThat(thrown).isInstanceOf(JobManagerException.class);
    assertThat(((JobManagerException) thrown).getErrorCode()).isEqualTo(JobManagerException.ErrorCode.NotServiceJob);
}