use of uk.gov.gchq.gaffer.operation.impl.job.GetJobDetails in project gaffer-doc by gchq.
the class GetGafferResultCacheExportExample method exportAndGetJobDetails.
public JobDetail exportAndGetJobDetails() {
// ---------------------------------------------------------
final OperationChain<JobDetail> opChain = new OperationChain.Builder().first(new GetAllElements()).then(new ExportToGafferResultCache<>()).then(new DiscardOutput()).then(new GetJobDetails()).build();
// ---------------------------------------------- -----------
jobDetail = runExample(opChain, null);
return jobDetail;
}
use of uk.gov.gchq.gaffer.operation.impl.job.GetJobDetails in project gaffer-doc by gchq.
the class GetJobDetailsExample method getJobDetailsInOperationChain.
public JobDetail getJobDetailsInOperationChain() {
// ---------------------------------------------------------
final OperationChain<JobDetail> opChain = new OperationChain.Builder().first(new GetAllElements()).then(new DiscardOutput()).then(new GetJobDetails()).build();
// ---------------------------------------------------------
final JobDetail jobDetail = runExample(opChain, null);
jobId = jobDetail.getJobId();
return jobDetail;
}
use of uk.gov.gchq.gaffer.operation.impl.job.GetJobDetails in project Gaffer by gchq.
the class GetJobDetailsTest method shouldJSONSerialiseAndDeserialise.
@Test
public void shouldJSONSerialiseAndDeserialise() throws SerialisationException {
// Given
final GetJobDetails operation = new GetJobDetails.Builder().jobId("jobId").build();
// When
byte[] json = JSONSerialiser.serialise(operation, true);
final GetJobDetails deserialisedOp = JSONSerialiser.deserialise(json, GetJobDetails.class);
// Then
assertEquals("jobId", deserialisedOp.getJobId());
}
use of uk.gov.gchq.gaffer.operation.impl.job.GetJobDetails in project Gaffer by gchq.
the class GetJobDetailsTest method builderShouldCreatePopulatedOperation.
@Test
@Override
public void builderShouldCreatePopulatedOperation() {
// When
final GetJobDetails op = new GetJobDetails.Builder().jobId("jobId").build();
// Then
assertEquals("jobId", op.getJobId());
}
use of uk.gov.gchq.gaffer.operation.impl.job.GetJobDetails in project Gaffer by gchq.
the class GetJobDetailsHandlerTest method shouldThrowExceptionIfJobTrackerIsNotConfigured.
@Test
public void shouldThrowExceptionIfJobTrackerIsNotConfigured() {
// Given
final GetJobDetailsHandler handler = new GetJobDetailsHandler();
final GetJobDetails operation = mock(GetJobDetails.class);
final Store store = mock(Store.class);
final User user = mock(User.class);
given(store.getJobTracker()).willReturn(null);
// When / Then
assertThatExceptionOfType(OperationException.class).isThrownBy(() -> handler.doOperation(operation, new Context(user), store)).extracting("message").isNotNull();
}
Aggregations