move endpoints that update network modifications to supervision controller#815
Conversation
…oller Signed-off-by: Radouane Khouadri <redouane.khouadri_externe@rte-france.com>
📝 WalkthroughWalkthroughThis PR relocates line-type catalog management endpoints from ChangesCatalog Endpoint Migration
Suggested reviewers
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/test/java/org/gridsuite/modification/server/SupervisionControllerTest.java (1)
136-169: ⚡ Quick winCentralize catalog cleanup to avoid inter-test state leakage.
These tests rely on an empty shared catalog at start; if a test fails before its trailing
DELETE, subsequent tests can fail for the wrong reason. Add an@AfterEachcleanup (or@BeforeEachreset) to make isolation deterministic.♻️ Suggested cleanup pattern
+import org.junit.jupiter.api.AfterEach; ... class SupervisionControllerTest { ... + `@AfterEach` + void cleanupCatalog() { + lineTypesCatalogService.deleteLineTypesCatalog(); + }Also applies to: 171-208, 223-251
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/test/java/org/gridsuite/modification/server/SupervisionControllerTest.java` around lines 136 - 169, Add deterministic catalog cleanup in SupervisionControllerTest by introducing an `@AfterEach` (or `@BeforeEach`) method that resets the line types catalog regardless of test outcome; implement it to call the same delete endpoint used in tests (mockMvc.perform(delete(SUPERVISION_URI_LINE_CATALOG)).andExpect(status().isOk())) or use a direct service clear method if available (lineTypesCatalogService.getAllLineTypes()/clear), and invoke this cleanup for every test including testGetLineTypesCatalog and the other catalog tests to prevent inter-test state leakage.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In
`@src/test/java/org/gridsuite/modification/server/SupervisionControllerTest.java`:
- Around line 136-169: Add deterministic catalog cleanup in
SupervisionControllerTest by introducing an `@AfterEach` (or `@BeforeEach`) method
that resets the line types catalog regardless of test outcome; implement it to
call the same delete endpoint used in tests
(mockMvc.perform(delete(SUPERVISION_URI_LINE_CATALOG)).andExpect(status().isOk()))
or use a direct service clear method if available
(lineTypesCatalogService.getAllLineTypes()/clear), and invoke this cleanup for
every test including testGetLineTypesCatalog and the other catalog tests to
prevent inter-test state leakage.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: c2c96415-fd32-4d1e-abe6-1d0603700b80
📒 Files selected for processing (4)
src/main/java/org/gridsuite/modification/server/NetworkModificationController.javasrc/main/java/org/gridsuite/modification/server/SupervisionController.javasrc/test/java/org/gridsuite/modification/server/ModificationControllerTest.javasrc/test/java/org/gridsuite/modification/server/SupervisionControllerTest.java
💤 Files with no reviewable changes (1)
- src/main/java/org/gridsuite/modification/server/NetworkModificationController.java
|



No description provided.