StubTableActionAlterations implements TableActionAlterations<T> { @NonNull @Override public Single<T> postInsert(@NonNull T t) { return Single.fromCallable(() -> { if (t == null) { throw new Exception("Post insert failed due to a null value"); } return t; }); }  @NonNull @Override Completable preGet(); @NonNull @Override Single<List<T>> postGet(@NonNull List<T> list); @NonNull @Override Single<T> preInsert(@NonNull T t); @NonNull @Override Single<T> postInsert(@NonNull T t); @NonNull @Override Single<T> preUpdate(@NonNull T oldT, @NonNull T newT); @NonNull @Override Single<T> postUpdate(@NonNull T oldT, @Nullable T newT); @NonNull @Override Single<T> preDelete(@NonNull T t); @NonNull @Override Single<T> postDelete(@Nullable T t);  }
@Test public void postInsert() { final Object object = new Object(); mStubTableActionAlterations.postInsert(object) .test() .assertValue(object) .assertComplete() .assertNoErrors(); }
@Test public void postInsertNull() { mStubTableActionAlterations.postInsert(null) .test() .assertNoValues() .assertNotComplete() .assertError(Exception.class); }