@Test
blic void testListJobs() throws Exception {

onfiguration config = new Configuration();
onfig.setString(JobManagerOptions.ADDRESS, "localhost");
estServerEndpointConfiguration rsec = RestServerEndpointConfiguration.fromConfiguration(config);
estListJobsHandler listJobsHandler = new TestListJobsHandler();
estServerEndpoint rse = new RestServerEndpoint(rsec) {
@Override
protected Collection<Tuple2<RestHandlerSpecification, ChannelInboundHandler>> initializeHandlers(CompletableFuture<String> restAddressFuture) {
	Collection<Tuple2<RestHandlerSpecification, ChannelInboundHandler>> handlers = new ArrayList<>();
	handlers.add(Tuple2.of(listJobsHandler.getMessageHeaders(), listJobsHandler));
	return handlers;
}
;
estClusterClient rcc = new RestClusterClient(config);
ry {
rse.start();
{
	CompletableFuture<Collection<JobStatusMessage>> jobDetailsFuture = rcc.listJobs();
	Collection<JobStatusMessage> jobDetails = jobDetailsFuture.get();
	Iterator<JobStatusMessage> jobDetailsIterator = jobDetails.iterator();
	JobStatusMessage job1 = jobDetailsIterator.next();
	JobStatusMessage job2 = jobDetailsIterator.next();
	Assert.assertNotEquals("The job statues should not be equal.", job1.getJobState(), job2.getJobState());
}
 finally {
rcc.shutdown();
rse.shutdown(Time.seconds(5));
}