@Test public void testCancel() throws Exception { final InitialPreviewResponse resp = createDatasetFromSQL(TestWebSocket.LONG_TEST_QUERY, null); final InitialTransformAndRunResponse runResp = expectSuccess( getBuilder( getAPIv2() .path(versionedResourcePath(resp.getDataset())) .path("transformAndRun") .queryParam("newVersion", newVersion()) ).buildPost(entity(new TransformSort("id", ASC), JSON)), InitialTransformAndRunResponse.class); JobId job = runResp.getJobId(); NotificationResponse response = expectSuccess( getBuilder( getAPIv2() .path("job") .path(job.getId()) .path("cancel") ).buildPost(entity(null, JSON)), NotificationResponse.class); assertEquals("Job cancellation requested", response.getMessage()); assertEquals(NotificationResponse.ResponseType.OK, response.getType()); }