@Test
public void testRetrieveTasksForJob() {

    JobStore store = getJobStore();
    Job<BatchJobExt> job = createBatchJobObject();
    store.init().await();
    store.storeJob(job).await();
    Pair<List<Job<?>>, Integer> jobsAndErrors = store.retrieveJobs().toBlocking().first();
    assertThat(jobsAndErrors.getLeft().get(0)).isEqualTo(job);
    Task task = createTaskObject(job);
    store.storeTask(task).await();
    Pair<List<Task>, Integer> tasks = store.retrieveTasksForJob(job.getId()).toBlocking().first();
    assertThat(tasks.getLeft().get(0)).isEqualTo(task);
    // Check that archive access does not return anything.
    Task archivedTask = store.retrieveArchivedTasksForJob(job.getId()).toBlocking().firstOrDefault(null);
    assertThat(archivedTask).isNull();
}