InternalRxSession extends AbstractRxQueryRunner implements RxSession { @Override public <T> Publisher<T> close() { return createEmptyPublisher( session::closeAsync ); } InternalRxSession( NetworkSession session ); @Override Publisher<RxTransaction> beginTransaction(); @Override Publisher<RxTransaction> beginTransaction( TransactionConfig config ); @Override Publisher<T> readTransaction( RxTransactionWork<? extends Publisher<T>> work ); @Override Publisher<T> readTransaction( RxTransactionWork<? extends Publisher<T>> work, TransactionConfig config ); @Override Publisher<T> writeTransaction( RxTransactionWork<? extends Publisher<T>> work ); @Override Publisher<T> writeTransaction( RxTransactionWork<? extends Publisher<T>> work, TransactionConfig config ); @Override RxResult run(String query, TransactionConfig config ); @Override RxResult run(String query, Map<String,Object> parameters, TransactionConfig config ); @Override RxResult run(Query query); @Override RxResult run(Query query, TransactionConfig config ); @Override Bookmark lastBookmark(); Publisher<Void> reset(); @Override Publisher<T> close();  }
@Test void shouldDelegateClose() throws Throwable { NetworkSession session = mock( NetworkSession.class ); when( session.closeAsync() ).thenReturn( completedWithNull() ); InternalRxSession rxSession = new InternalRxSession( session ); Publisher<Void> mono = rxSession.close(); StepVerifier.create( mono ).verifyComplete(); verify( session ).closeAsync(); verifyNoMoreInteractions( session ); }