@Test public void testCancel() throws IOException {

  setSession();
  final UUID uuid = UUID.randomUUID();
  final JobManager jobManager = new JobManager();
  final Future future = mock( Future.class );
  when( executor.getFuture( uuid, session ) ).thenReturn( future );
  final Response response = jobManager.cancel( uuid.toString() );
  assertNotNull( response );
  assertEquals( 200, response.getStatus() );
  verify( future, times( 1 ) ).cancel( true );
}