Skip to content

Commit 020a83e

Browse files
committed
Chapter 4: Update test to use PanacheMock
1 parent dc412c5 commit 020a83e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

chapter-4/chapter-4-quarkus-panache-reactive-activerecord/src/test/java/org/acme/rest/FruitResourceTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ public void getFruitNotFound() {
7979
@Test
8080
public void addFruit() {
8181
PanacheMock.mock(Fruit.class);
82-
Mockito.when(Fruit.persist(Mockito.any(Fruit.class), Mockito.any()))
83-
.thenReturn(Uni.createFrom().voidItem());
82+
PanacheMock.doReturn(Uni.createFrom().voidItem())
83+
.when(Fruit.class).persist(Mockito.any(Fruit.class), Mockito.any());
8484

8585
given()
8686
.when()

0 commit comments

Comments
 (0)