CategoriesTableActionAlterations extends StubTableActionAlterations<Category> { @NonNull @Override public Single<Category> postUpdate(@NonNull Category oldCategory, @Nullable Category newCategory) { return super.postUpdate(oldCategory, newCategory) .doOnSuccess(ignored -> receiptsTable.clearCache()); } CategoriesTableActionAlterations(@NonNull ReceiptsTable receiptsTable); @NonNull @Override Single<Category> postUpdate(@NonNull Category oldCategory, @Nullable Category newCategory); @NonNull @Override Single<Category> postDelete(@Nullable Category category);  }
@Test public void postUpdate() { alterations.postUpdate(category1, category2) .test() .assertValue(category2) .assertComplete() .assertNoErrors(); verify(receiptsTable).clearCache(); }