Search in sources :

Example 1 with Book

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());
}
Also used : Book(com.radcortez.quarkus.playground.services.book.entity.Book) Test(org.junit.jupiter.api.Test) QuarkusTest(io.quarkus.test.junit.QuarkusTest)

Example 2 with Book

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;
}
Also used : Book(com.radcortez.quarkus.playground.services.book.entity.Book) WithSpan(io.opentelemetry.extension.annotations.WithSpan)

Aggregations

Book (com.radcortez.quarkus.playground.services.book.entity.Book)2 WithSpan (io.opentelemetry.extension.annotations.WithSpan)1 QuarkusTest (io.quarkus.test.junit.QuarkusTest)1 Test (org.junit.jupiter.api.Test)1