test_class.declarator: ISBN = 9780134494166L
test_class.modifier: private static final
test_class.original_string: private static final long ISBN = 9780134494166L;
test_class.type: long
test_class.var_name: ISBN
test_class.declarator: ROBERT_C_MARTIN = "Robert C. Martin"
test_class.modifier: private static final
test_class.original_string: private static final String ROBERT_C_MARTIN = "Robert C. Martin";
test_class.type: String
test_class.var_name: ROBERT_C_MARTIN
test_class.declarator: CLEAN_ARCHITECTURE = "Clean Architecture"
test_class.modifier: private static final
test_class.original_string: private static final String CLEAN_ARCHITECTURE = "Clean Architecture";
test_class.type: String
test_class.var_name: CLEAN_ARCHITECTURE
test_class.declarator: cleanArchitectureBook
test_class.modifier: private
test_class.original_string: private Book cleanArchitectureBook;
test_class.type: Book
test_class.var_name: cleanArchitectureBook
test_class.declarator: bookGateway
test_class.modifier: @Mock
    private
test_class.original_string: @Mock
    private BookGateway bookGateway;
test_class.type: BookGateway
test_class.var_name: bookGateway
test_class.declarator: findBookListsByAuthorInteractor = new FindBookListsByAuthorInteractor(bookGateway)
test_class.modifier: @InjectMocks
    private
test_class.original_string: @InjectMocks
    private FindBookListsByAuthorInteractor findBookListsByAuthorInteractor = new FindBookListsByAuthorInteractor(bookGateway);
test_class.type: FindBookListsByAuthorInteractor
test_class.var_name: findBookListsByAuthorInteractor
test_class.file: domain/src/test/java/com/xala3pa/books/Interactor/FindBookListsByAuthorInteractorTest.java
test_class.identifier: FindBookListsByAuthorInteractorTest
test_case.body: @Test
    public void should_return_list_of_books_by_author() {
  
      BookListByAuthorInputData bookListByAuthorInputData = BookListByAuthorInputData.builder()
          .author(ROBERT_C_MARTIN)
          .build();
  
      Optional<List<Book>> books = Optional.of(Collections.singletonList(cleanArchitectureBook));
  
      when(bookGateway.findByAuthor(any(String.class))).thenReturn(books);
  
      List<BookOutputData> bookOutputData =  findBookListsByAuthorInteractor.getBooks(bookListByAuthorInputData);
  
      assertThat(bookOutputData.size()).isNotZero();
      assertThat(bookOutputData.get(0).getAuthor()).isEqualTo(ROBERT_C_MARTIN);
    }
test_case.class_method_signature: FindBookListsByAuthorInteractorTest.should_return_list_of_books_by_author()
test_case.full_signature: @Test public void should_return_list_of_books_by_author()
test_case.identifier: should_return_list_of_books_by_author
test_case.invocations: build author builder of singletonList thenReturn when findByAuthor any getBooks isNotZero assertThat size isEqualTo assertThat getAuthor get
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void should_return_list_of_books_by_author()
focal_class.declarator: bookGateway
focal_class.modifier: private
focal_class.original_string: private BookGateway bookGateway;
focal_class.type: BookGateway
focal_class.var_name: bookGateway
focal_class.file: domain/src/main/java/com/xala3pa/books/Interactor/FindBookListsByAuthorInteractor.java
focal_class.identifier: FindBookListsByAuthorInteractor
focal_class.interfaces: implements FindBookListByAuthor
focal_class.class_method_signature: FindBookListsByAuthorInteractor.FindBookListsByAuthorInteractor(BookGateway bookGateway)
focal_class.full_signature: public  FindBookListsByAuthorInteractor(BookGateway bookGateway)
focal_class.identifier: FindBookListsByAuthorInteractor
focal_class.modifiers: public
focal_class.parameters: (BookGateway bookGateway)
focal_class.signature:  FindBookListsByAuthorInteractor(BookGateway bookGateway)
focal_class.class_method_signature: FindBookListsByAuthorInteractor.getBooks(BookListByAuthorInputData bookListByAuthorInputData)
focal_class.full_signature: @Override public List<BookOutputData> getBooks(BookListByAuthorInputData bookListByAuthorInputData)
focal_class.identifier: getBooks
focal_class.modifiers: @Override public
focal_class.parameters: (BookListByAuthorInputData bookListByAuthorInputData)
focal_class.return: List<BookOutputData>
focal_class.signature: List<BookOutputData> getBooks(BookListByAuthorInputData bookListByAuthorInputData)
focal_method.body: @Override
    public List<BookOutputData> getBooks(BookListByAuthorInputData bookListByAuthorInputData) {
      Optional<List<Book>> books = bookGateway.findByAuthor(bookListByAuthorInputData.getAuthor());
  
      if (!books.isPresent()) {
        throw new BooksNotFoundException();
      }
  
      return books.get().stream().map(Book::mapToBookOutputData).collect(Collectors.toList());
    }
focal_method.class_method_signature: FindBookListsByAuthorInteractor.getBooks(BookListByAuthorInputData bookListByAuthorInputData)
focal_method.full_signature: @Override public List<BookOutputData> getBooks(BookListByAuthorInputData bookListByAuthorInputData)
focal_method.identifier: getBooks
focal_method.invocations: findByAuthor getAuthor isPresent collect map stream get toList
focal_method.modifiers: @Override public
focal_method.parameters: (BookListByAuthorInputData bookListByAuthorInputData)
focal_method.return: List<BookOutputData>
focal_method.signature: List<BookOutputData> getBooks(BookListByAuthorInputData bookListByAuthorInputData)