Skip to content
This repository has been archived by the owner on Oct 24, 2024. It is now read-only.

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
RiccardoGiuliani committed Apr 19, 2024
1 parent ff8aaa9 commit e332006
Showing 1 changed file with 3 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,25 +73,17 @@ void testCreateTerminal_Failure() {

@Test
void whenGetTerminalListThenSuccess() {
TerminalEntity terminalEntity1 = new TerminalEntity();
TerminalEntity terminalEntity2 = new TerminalEntity();
terminalEntity1.terminalUuid = "uuid1";
terminalEntity1.serviceProviderId = "serviceProviderId";
terminalEntity2.terminalUuid = "uuid2";
terminalEntity2.serviceProviderId = "serviceProviderId";
List<TerminalEntity> terminalEntities= List.of(terminalEntity1,terminalEntity2);

ReactivePanacheQuery<TerminalEntity> query = Mockito.mock(ReactivePanacheQuery.class);
Mockito.when(query.page(anyInt(), anyInt())).thenReturn(query);
Mockito.when(query.list()).thenReturn(Uni.createFrom().item(terminalEntities));
Mockito.when(query.list()).thenReturn(Uni.createFrom().item(mockedList()));
Mockito.when(terminalRepository.find("serviceProviderId", "serviceProviderId")).thenReturn(query);

var terminalList = terminalService.getTerminalListPaged("serviceProviderId", 0, 10);

terminalList
.subscribe()
.withSubscriber(UniAssertSubscriber.create())
.assertItem(terminalEntities);

.assertItem(mockedList());
}

@Test
Expand Down

0 comments on commit e332006

Please sign in to comment.