@Test
public void testUpdateTask() {

    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();
    Task retrievedTask = store.retrieveTask(task.getId()).toBlocking().first();
    assertThat(task).isEqualTo(retrievedTask);
    BatchJobTask newTask = BatchJobTask.newBuilder((BatchJobTask) task)
            .withStatus(TaskStatus.newBuilder().withState(TaskState.Finished).build())
            .build();
    store.updateTask(newTask).await();
    Task newRetrievedTask = store.retrieveTask(newTask.getId()).toBlocking().first();
    assertThat(newTask).isEqualTo(newRetrievedTask);
}