From b7b94ed213fa9ec446e78232b6bfcaad7ce90fcb Mon Sep 17 00:00:00 2001 From: pierre-maraval Date: Mon, 6 May 2024 15:47:35 +0200 Subject: [PATCH] =?UTF-8?q?Fix=20TU=20suite=20=C3=A0=20modif=20sur=20pagin?= =?UTF-8?q?ation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/abes/item/web/impl/DemandeRestServiceTest.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/web/src/test/java/fr/abes/item/web/impl/DemandeRestServiceTest.java b/web/src/test/java/fr/abes/item/web/impl/DemandeRestServiceTest.java index 9dc1d9dd..22f5f5b3 100644 --- a/web/src/test/java/fr/abes/item/web/impl/DemandeRestServiceTest.java +++ b/web/src/test/java/fr/abes/item/web/impl/DemandeRestServiceTest.java @@ -83,7 +83,7 @@ void init() { @Test @WithMockUser(authorities = {"ADMIN"}) void testGetAllActiveDemandes() throws Exception { - Mockito.when(demandeExempService.getAllActiveDemandesForAdminExtended(page, size)).thenReturn(this.demandeExemps); + Mockito.when(demandeExempService.getAllActiveDemandesForAdminExtended(page-1, size)).thenReturn(this.demandeExemps); this.mockMvc.perform(get("/api/v1/demandes?type=EXEMP&extension=true&page=1&size=10").requestAttr("iln", "1")) .andExpect(status().isOk()) .andExpect(jsonPath("$[0].id").value("1")) @@ -94,7 +94,7 @@ void testGetAllActiveDemandes() throws Exception { .andExpect(jsonPath("$[1].typeExemp").value("Monographies")); - Mockito.when(demandeExempService.getAllActiveDemandesForAdmin("1", page, size)).thenReturn(this.demandeExemps); + Mockito.when(demandeExempService.getAllActiveDemandesForAdmin("1", page-1, size)).thenReturn(this.demandeExemps); this.mockMvc.perform(get("/api/v1/demandes?type=EXEMP&extension=false&page=1&size=10").requestAttr("iln", "1")) .andExpect(status().isOk()) .andExpect(jsonPath("$[0].id").value("1")) @@ -106,7 +106,7 @@ void testGetAllActiveDemandes() throws Exception { @Test @WithMockUser(authorities = {"USER"}) void testChercher() throws Exception { - Mockito.when(demandeExempService.getActiveDemandesForUser("1", page, size)).thenReturn(this.demandeExemps); + Mockito.when(demandeExempService.getActiveDemandesForUser("1", page-1, size)).thenReturn(this.demandeExemps); this.mockMvc.perform(get("/api/v1/chercherDemandes?type=EXEMP&extension=true&page=1&size=10").requestAttr("iln", "1")) .andExpect(status().isOk()) .andExpect(jsonPath("$[0].id").value("1")) @@ -118,7 +118,7 @@ void testChercher() throws Exception { @Test @WithMockUser(authorities = {"USER"}) void testGetAllArchivedDemandes() throws Exception { - Mockito.when(demandeExempService.getAllArchivedDemandesAllIln(page, size)).thenReturn(this.demandeExemps); + Mockito.when(demandeExempService.getAllArchivedDemandesAllIln(page-1, size)).thenReturn(this.demandeExemps); this.mockMvc.perform(get("/api/v1/chercherArchives?type=EXEMP&extension=true&page=1&size=10").requestAttr("iln", "1")) .andExpect(status().isOk()) .andExpect(jsonPath("$[0].id").value("1")) @@ -126,7 +126,7 @@ void testGetAllArchivedDemandes() throws Exception { .andExpect(jsonPath("$[1].id").value("2")) .andExpect(jsonPath("$[1].rcr").value("222222222")); - Mockito.when(demandeExempService.getAllArchivedDemandes("1", page, size)).thenReturn(this.demandeExemps); + Mockito.when(demandeExempService.getAllArchivedDemandes("1", page-1, size)).thenReturn(this.demandeExemps); this.mockMvc.perform(get("/api/v1/chercherArchives?type=EXEMP&extension=false&page=1&size=10").requestAttr("iln", "1")) .andExpect(status().isOk()) .andExpect(jsonPath("$[0].id").value("1"))