use of org.apache.flink.runtime.client.JobInitializationException in project flink by apache.
the class ClientUtilsTest method testWaitUntilJobInitializationFinished_throwsInitializationException.
/**
* Ensure that the waitUntilJobInitializationFinished() method throws
* JobInitializationException.
*/
@Test
public void testWaitUntilJobInitializationFinished_throwsInitializationException() {
Iterator<JobStatus> statusSequenceIterator = Arrays.asList(JobStatus.INITIALIZING, JobStatus.INITIALIZING, JobStatus.FAILED).iterator();
CommonTestUtils.assertThrows("Something is wrong", JobInitializationException.class, () -> {
ClientUtils.waitUntilJobInitializationFinished(statusSequenceIterator::next, () -> {
Throwable throwable = new JobInitializationException(TESTING_JOB_ID, "Something is wrong", new RuntimeException("Err"));
return buildJobResult(throwable);
}, ClassLoader.getSystemClassLoader());
return null;
});
}
Aggregations