BookBorrowingContentProviderRepository implements BookBorrowingRepository { @Override public List<BookBorrowing> borrowedBooks() { Cursor borrowedBooksCursor = contentResolver .query(VilibraContract.BORROWING_CONTENT_URI, null, null, null, null); List<BookBorrowing> borrowedBooks = this.bookBorrowingContentProviderMapper.transform(borrowedBooksCursor); borrowedBooksCursor.close(); return borrowedBooks; } @Inject  BookBorrowingContentProviderRepository(ContentResolver contentResolver); @Override List<BookBorrowing> borrowedBooks(); @Override void addBookBorrowing(BookBorrowing bookBorrowing); @Override void removeBookBorrowing(BookBorrowing bookBorrowing);  }
@Test public void testOneBorrowedBook() throws Exception { List<BookBorrowing> borrowedBooks = this.bookBorrowingRepository.borrowedBooks(); assertThat(borrowedBooks.size(), is(1)); BookBorrowing bookBorrowing = borrowedBooks.get(0); assertThat(bookBorrowing, equalTo(this.testBookBorrowing)); }