From e33200656ca99c75592e1416dacc2590cd837efe Mon Sep 17 00:00:00 2001 From: RiccardoGiuliani Date: Fri, 19 Apr 2024 13:07:41 +0200 Subject: [PATCH] Fix test --- .../swclient/mil/service/TerminalServiceTest.java | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/test/java/it/pagopa/swclient/mil/service/TerminalServiceTest.java b/src/test/java/it/pagopa/swclient/mil/service/TerminalServiceTest.java index 7afd0ae..aa05b15 100644 --- a/src/test/java/it/pagopa/swclient/mil/service/TerminalServiceTest.java +++ b/src/test/java/it/pagopa/swclient/mil/service/TerminalServiceTest.java @@ -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 terminalEntities= List.of(terminalEntity1,terminalEntity2); - ReactivePanacheQuery 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