use of com.radcortez.quarkus.playground.services.book.entity.Book in project quarkus-playground by radcortez.
the class BookRepositoryTest method update.
@Test
void update() {
final Optional<Book> book = bookRepository.create(Book.builder().author("").title("Uzumaki Naruto").genre("Manga").build());
assertTrue(book.isPresent());
final Book bookUpdate = book.get();
bookUpdate.setYear(1997);
final Optional<Book> updated = bookRepository.update(bookUpdate.getId(), bookUpdate);
assertTrue(updated.isPresent());
final Book bookUpdated = updated.get();
assertEquals(1997, bookUpdated.getYear());
}
use of com.radcortez.quarkus.playground.services.book.entity.Book in project quarkus-playground by radcortez.
the class IsbnGeneratorFallback method handle.
@Override
@WithSpan
public Book handle(final ExecutionContext executionContext) {
Book book = (Book) executionContext.getParameters()[0];
book.setIsbn("ISBN-FALLBACK");
emitter.send(Message.of(book, Metadata.of(TracingMetadata.withCurrent(Context.current()))));
return book;
}
Aggregations