@Test public void postDeleteNull() throws Exception { mTripTableActionAlterations.postDelete(null) .test() .assertNoValues() .assertNotComplete() .assertError(Exception.class); verifyZeroInteractions(mReceiptsTable, mDistanceTable); }
@NonNull @Override public Single<Trip> postDelete(@Nullable final Trip trip) { return Single.fromCallable(() -> { if (trip == null) { throw new Exception("Post delete failed due to a null trip"); } mReceiptsTable.deleteParentBlocking(trip); mDistanceTable.deleteParentBlocking(trip); if (!mStorageManager.deleteRecursively(trip.getDirectory())) { Logger.error(this, "Failed to fully delete the underlying data. Create a clean up script to fix this later"); } return trip; }); }
TripTableActionAlterations extends StubTableActionAlterations<Trip> { @NonNull @Override public Single<Trip> postDelete(@Nullable final Trip trip) { return Single.fromCallable(() -> { if (trip == null) { throw new Exception("Post delete failed due to a null trip"); } mReceiptsTable.deleteParentBlocking(trip); mDistanceTable.deleteParentBlocking(trip); if (!mStorageManager.deleteRecursively(trip.getDirectory())) { Logger.error(this, "Failed to fully delete the underlying data. Create a clean up script to fix this later"); } return trip; }); } }
TripTableActionAlterations extends StubTableActionAlterations<Trip> { @NonNull @Override public Single<Trip> postDelete(@Nullable final Trip trip) { return Single.fromCallable(() -> { if (trip == null) { throw new Exception("Post delete failed due to a null trip"); } mReceiptsTable.deleteParentBlocking(trip); mDistanceTable.deleteParentBlocking(trip); if (!mStorageManager.deleteRecursively(trip.getDirectory())) { Logger.error(this, "Failed to fully delete the underlying data. Create a clean up script to fix this later"); } return trip; }); } TripTableActionAlterations(@NonNull PersistenceManager persistenceManager);  TripTableActionAlterations(@NonNull DatabaseHelper databaseHelper, @NonNull StorageManager storageManager);  TripTableActionAlterations(@NonNull Table<Trip> tripsTable, @NonNull ReceiptsTable receiptsTable, @NonNull DistanceTable distanceTable,
                                      @NonNull DatabaseHelper databaseHelper, @NonNull StorageManager storageManager); }
TripTableActionAlterations extends StubTableActionAlterations<Trip> { @NonNull @Override public Single<Trip> postDelete(@Nullable final Trip trip) { return Single.fromCallable(() -> { if (trip == null) { throw new Exception("Post delete failed due to a null trip"); } mReceiptsTable.deleteParentBlocking(trip); mDistanceTable.deleteParentBlocking(trip); if (!mStorageManager.deleteRecursively(trip.getDirectory())) { Logger.error(this, "Failed to fully delete the underlying data. Create a clean up script to fix this later"); } return trip; }); } TripTableActionAlterations(@NonNull PersistenceManager persistenceManager);  TripTableActionAlterations(@NonNull DatabaseHelper databaseHelper, @NonNull StorageManager storageManager);  TripTableActionAlterations(@NonNull Table<Trip> tripsTable, @NonNull ReceiptsTable receiptsTable, @NonNull DistanceTable distanceTable,
                                      @NonNull DatabaseHelper databaseHelper, @NonNull StorageManager storageManager); @NonNull @Override Single<List<Trip>> postGet(@NonNull final List<Trip> trips); @NonNull @Override Single<Trip> postInsert(@NonNull final Trip postInsertTrip); @NonNull @Override Single<Trip> postUpdate(@NonNull final Trip oldTrip, @Nullable final Trip newTrip); @NonNull @Override Single<Trip> postDelete(@Nullable final Trip trip); }
TripTableActionAlterations extends StubTableActionAlterations<Trip> { @NonNull @Override public Single<Trip> postDelete(@Nullable final Trip trip) { return Single.fromCallable(() -> { if (trip == null) { throw new Exception("Post delete failed due to a null trip"); } mReceiptsTable.deleteParentBlocking(trip); mDistanceTable.deleteParentBlocking(trip); if (!mStorageManager.deleteRecursively(trip.getDirectory())) { Logger.error(this, "Failed to fully delete the underlying data. Create a clean up script to fix this later"); } return trip; }); } TripTableActionAlterations(@NonNull PersistenceManager persistenceManager);  TripTableActionAlterations(@NonNull DatabaseHelper databaseHelper, @NonNull StorageManager storageManager);  TripTableActionAlterations(@NonNull Table<Trip> tripsTable, @NonNull ReceiptsTable receiptsTable, @NonNull DistanceTable distanceTable,
                                      @NonNull DatabaseHelper databaseHelper, @NonNull StorageManager storageManager); @NonNull @Override Single<List<Trip>> postGet(@NonNull final List<Trip> trips); @NonNull @Override Single<Trip> postInsert(@NonNull final Trip postInsertTrip); @NonNull @Override Single<Trip> postUpdate(@NonNull final Trip oldTrip, @Nullable final Trip newTrip); @NonNull @Override Single<Trip> postDelete(@Nullable final Trip trip);  }