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: findBookByIsbnInteractor = new FindBookByIsbnInteractor(
        bookGateway)
test_class.modifier: @InjectMocks
    private
test_class.original_string: @InjectMocks
    private FindBookByIsbnInteractor findBookByIsbnInteractor = new FindBookByIsbnInteractor(
        bookGateway);
test_class.type: FindBookByIsbnInteractor
test_class.var_name: findBookByIsbnInteractor
test_class.file: domain/src/test/java/com/xala3pa/books/Interactor/FindBookByIsbnInteractorTest.java
test_class.identifier: FindBookByIsbnInteractorTest
test_case.body: @Test
    public void should_return_a_book_when_we_search_by_isbn() throws Exception {
  
      BookByIsbnInputData bookByIsbnInputData = BookByIsbnInputData.builder()
          .isbn(ISBN)
          .build();
  
      Optional<Book> book = Optional.of(cleanArchitectureBook);
  
          when(bookGateway.getBookByIsbn(any(Long.class))).thenReturn(book);
  
      BookOutputData bookOutputData = findBookByIsbnInteractor.getBook(bookByIsbnInputData);
  
      assertThat(bookOutputData).isEqualToComparingFieldByField(cleanArchitectureBook.mapToBookOutputData());
    }
test_case.class_method_signature: FindBookByIsbnInteractorTest.should_return_a_book_when_we_search_by_isbn()
test_case.full_signature: @Test public void should_return_a_book_when_we_search_by_isbn()
test_case.identifier: should_return_a_book_when_we_search_by_isbn
test_case.invocations: build isbn builder of thenReturn when getBookByIsbn any getBook isEqualToComparingFieldByField assertThat mapToBookOutputData
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void should_return_a_book_when_we_search_by_isbn()
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/FindBookByIsbnInteractor.java
focal_class.identifier: FindBookByIsbnInteractor
focal_class.interfaces: implements FindBookByIsbn
focal_class.class_method_signature: FindBookByIsbnInteractor.FindBookByIsbnInteractor(BookGateway bookGateway)
focal_class.full_signature: public  FindBookByIsbnInteractor(BookGateway bookGateway)
focal_class.identifier: FindBookByIsbnInteractor
focal_class.modifiers: public
focal_class.parameters: (BookGateway bookGateway)
focal_class.signature:  FindBookByIsbnInteractor(BookGateway bookGateway)
focal_class.class_method_signature: FindBookByIsbnInteractor.getBook(BookByIsbnInputData bookByIsbnInputData)
focal_class.full_signature: @Override public BookOutputData getBook(BookByIsbnInputData bookByIsbnInputData)
focal_class.identifier: getBook
focal_class.modifiers: @Override public
focal_class.parameters: (BookByIsbnInputData bookByIsbnInputData)
focal_class.return: BookOutputData
focal_class.signature: BookOutputData getBook(BookByIsbnInputData bookByIsbnInputData)
focal_method.body: @Override
    public BookOutputData getBook(BookByIsbnInputData bookByIsbnInputData) {
      Optional<Book> book = bookGateway.getBookByIsbn(bookByIsbnInputData.getIsbn());
  
      if(!book.isPresent()) {
        throw new BooksNotFoundException();
      }
  
      return book.get().mapToBookOutputData();
    }
focal_method.class_method_signature: FindBookByIsbnInteractor.getBook(BookByIsbnInputData bookByIsbnInputData)
focal_method.full_signature: @Override public BookOutputData getBook(BookByIsbnInputData bookByIsbnInputData)
focal_method.identifier: getBook
focal_method.invocations: getBookByIsbn getIsbn isPresent mapToBookOutputData get
focal_method.modifiers: @Override public
focal_method.parameters: (BookByIsbnInputData bookByIsbnInputData)
focal_method.return: BookOutputData
focal_method.signature: BookOutputData getBook(BookByIsbnInputData bookByIsbnInputData)