@Test
    public void
        shouldThrowExceptionIfNoTypeMappingWasFoundWithTransactionWithoutAffectingDbBlocking() {
      final StorIOSQLite storIOSQLite = mock(StorIOSQLite.class);
      final StorIOSQLite.Internal internal = mock(StorIOSQLite.Internal.class);

      when(storIOSQLite.lowLevel()).thenReturn(internal);

      when(storIOSQLite.put()).thenReturn(new PreparedPut.Builder(storIOSQLite));

      final List<TestItem> items = asList(TestItem.newInstance(), TestItem.newInstance());

      final PreparedPut<PutResults<TestItem>> preparedPut =
          storIOSQLite.put().objects(items).useTransaction(true).prepare();

      try {
        preparedPut.executeAsBlocking();
        failBecauseExceptionWasNotThrown(StorIOException.class);
      } catch (StorIOException expected) {
        // it's okay, no type mapping was found
        assertThat(expected).hasCauseInstanceOf(IllegalStateException.class);
      }

      verify(storIOSQLite).put();
      verify(storIOSQLite).lowLevel();
      verify(internal).typeMapping(TestItem.class);
      verify(internal, never()).insert(any(InsertQuery.class), any(ContentValues.class));
      verify(internal, never()).update(any(UpdateQuery.class), any(ContentValues.class));
      verifyNoMoreInteractions(storIOSQLite, internal);
    }
    @Test
    public void
        shouldThrowExceptionIfNoTypeMappingWasFoundWithTransactionWithoutAffectingDbAsObservable() {
      final StorIOSQLite storIOSQLite = mock(StorIOSQLite.class);
      final StorIOSQLite.Internal internal = mock(StorIOSQLite.Internal.class);

      when(storIOSQLite.internal()).thenReturn(internal);

      when(storIOSQLite.delete()).thenReturn(new PreparedDelete.Builder(storIOSQLite));

      final List<TestItem> items = asList(TestItem.newInstance(), TestItem.newInstance());

      final TestSubscriber<DeleteResults<TestItem>> testSubscriber =
          new TestSubscriber<DeleteResults<TestItem>>();

      storIOSQLite
          .delete()
          .objects(items)
          .useTransaction(true)
          .prepare()
          .createObservable()
          .subscribe(testSubscriber);

      testSubscriber.awaitTerminalEvent();
      testSubscriber.assertNoValues();
      assertThat(testSubscriber.getOnErrorEvents().get(0))
          .isInstanceOf(StorIOException.class)
          .hasCauseInstanceOf(IllegalStateException.class);

      verify(storIOSQLite).delete();
      verify(storIOSQLite).internal();
      verify(internal).typeMapping(TestItem.class);
      verify(internal, never()).delete(any(DeleteQuery.class));
      verifyNoMoreInteractions(storIOSQLite, internal);
    }
    @Test
    public void
        shouldThrowExceptionIfNoTypeMappingWasFoundWithoutTransactionWithoutAffectingDbAsCompletable() {
      final StorIOSQLite storIOSQLite = mock(StorIOSQLite.class);
      final StorIOSQLite.Internal internal = mock(StorIOSQLite.Internal.class);

      when(storIOSQLite.lowLevel()).thenReturn(internal);

      when(storIOSQLite.put()).thenReturn(new PreparedPut.Builder(storIOSQLite));

      final List<TestItem> items = asList(TestItem.newInstance(), TestItem.newInstance());

      final TestSubscriber<PutResults<TestItem>> testSubscriber =
          new TestSubscriber<PutResults<TestItem>>();

      storIOSQLite
          .put()
          .objects(items)
          .useTransaction(false)
          .prepare()
          .asRxCompletable()
          .subscribe(testSubscriber);

      testSubscriber.awaitTerminalEvent();
      testSubscriber.assertNoValues();
      assertThat(testSubscriber.getOnErrorEvents().get(0))
          .isInstanceOf(StorIOException.class)
          .hasCauseInstanceOf(IllegalStateException.class);

      verify(storIOSQLite).put();
      verify(storIOSQLite).lowLevel();
      verify(storIOSQLite).defaultScheduler();
      verify(internal).typeMapping(TestItem.class);
      verify(internal, never()).insert(any(InsertQuery.class), any(ContentValues.class));
      verify(internal, never()).update(any(UpdateQuery.class), any(ContentValues.class));
      verifyNoMoreInteractions(storIOSQLite, internal);
    }