    @Test
    public void update() throws Exception {

        final Job test = createTestJob();
        final String json = gson.toJson(test);
        final String key = SimpleUploadDataStore.jobIdKey(test.id());
        final Set<String> keys = new HashSet<>();
        keys.add(key);

        final SharedPreferences.Editor editor = sharedPreferences.edit();
        editor.putStringSet(SimpleUploadDataStore.KEY_JOB_IDS, keys);
        editor.putString(key, json);
        editor.apply();

        final TestSubscriber<Job> ts = TestSubscriber.create();
        dataStore.update(Status.createCompleted(test.id(), null)).subscribe(ts);

        ts.awaitTerminalEvent(1, TimeUnit.SECONDS);
        ts.assertNoErrors();
        ts.assertValueCount(1);
        ts.assertValue(test.withStatus(Status.createCompleted(test.id(), null)));
    }