Commit 91826d00 authored by Ondřej Pavlica's avatar Ondřej Pavlica
Browse files

Fix order service test mock

parent 2ffbba7f
Pipeline #140819 passed with stages
in 3 minutes and 7 seconds
......@@ -49,10 +49,10 @@ public class OrderServiceTests extends PersistenceServiceTestBase<OrderDto, Orde
void testGetWithBottle() {
getPersistenceService(); // Force lazy load
var dao = getMockedDao();
Mockito.when(dao.get(1)).thenReturn(getTestEntity());
Mockito.when(dao.get(1, false)).thenReturn(getTestEntity());
var dto = orderService.get(1, true);
assertThat(equals(dto, getTestEntity())).isTrue();
Mockito.verify(dao, Mockito.times(1)).get(1);
Mockito.verify(dao, Mockito.times(1)).get(1, false);
assertThat(dto.getItems().stream().findFirst().get().getWineBottle().getName())
.isEqualTo(getTestEntity().getItems().stream().findFirst().get().getBottle().getName());
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment