diff --git a/src/main/java/org/gridsuite/modification/server/repositories/NetworkModificationRepository.java b/src/main/java/org/gridsuite/modification/server/repositories/NetworkModificationRepository.java index cb12d47ee..aa87d035b 100644 --- a/src/main/java/org/gridsuite/modification/server/repositories/NetworkModificationRepository.java +++ b/src/main/java/org/gridsuite/modification/server/repositories/NetworkModificationRepository.java @@ -177,10 +177,10 @@ public List getModificationsInfos(List groupUuids, bool Stream modificationEntity = groupUuids.stream().flatMap(this::getModificationEntityStream); if (onlyStashed) { return modificationEntity.filter(m -> m.getStashed() == onlyStashed) - .map(ModificationEntity::toModificationInfos) + .map(this::getModificationInfos) .collect(Collectors.toList()); } else { - return modificationEntity.map(ModificationEntity::toModificationInfos) + return modificationEntity.map(this::getModificationInfos) .collect(Collectors.toList()); } } diff --git a/src/test/java/org/gridsuite/modification/server/modifications/tabularmodifications/TabularGeneratorModificationsTest.java b/src/test/java/org/gridsuite/modification/server/modifications/tabularmodifications/TabularGeneratorModificationsTest.java index 4e9fa82fd..f5088048a 100644 --- a/src/test/java/org/gridsuite/modification/server/modifications/tabularmodifications/TabularGeneratorModificationsTest.java +++ b/src/test/java/org/gridsuite/modification/server/modifications/tabularmodifications/TabularGeneratorModificationsTest.java @@ -120,6 +120,13 @@ public void testCheckSqlRequestsCount() throws Exception { .andReturn(); // We check that the request count is not dependent on the number of sub modifications of the tabular modification (the JPA N+1 problem is correctly solved) assertSelectCount(3); + reset(); + + // We get the modifications of the group (so the 2 tabular modifications) + mockMvc.perform(get("/v1/groups/{groupUuid}/network-modifications", getGroupId())) + .andExpect(status().isOk()); + // We check that the request count is not dependent on the number of sub modifications of the tabular modification (the JPA N+1 problem is correctly solved) + assertSelectCount(6); } @Test