From cc1fa74c63440c4a39f57f8b1b8e35db60b55ca3 Mon Sep 17 00:00:00 2001 From: ouyangxq <775153912@qq.com> Date: Mon, 5 Oct 2026 03:45:05 +0800 Subject: [PATCH] test(dispatch): register grouped draft in browser API boundary --- .../lastleg/controller/Phase4BrowserApiBoundaryTest.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lastleg-service/src/test/java/com/baiyue/lastleg/controller/Phase4BrowserApiBoundaryTest.java b/lastleg-service/src/test/java/com/baiyue/lastleg/controller/Phase4BrowserApiBoundaryTest.java index 85e786ae1..3cdfb5d6c 100644 --- a/lastleg-service/src/test/java/com/baiyue/lastleg/controller/Phase4BrowserApiBoundaryTest.java +++ b/lastleg-service/src/test/java/com/baiyue/lastleg/controller/Phase4BrowserApiBoundaryTest.java @@ -25,6 +25,7 @@ import java.nio.file.Path; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; class Phase4BrowserApiBoundaryTest { @Test @@ -95,8 +96,12 @@ class Phase4BrowserApiBoundaryTest { assertFalse(condition.matchIfMissing()); assertTrue(Arrays.stream(SmartDispatchController.class.getDeclaredMethods()) .filter(method -> method.isAnnotationPresent(GetMapping.class)).count() == 2); - assertTrue(Arrays.stream(SmartDispatchController.class.getDeclaredMethods()) - .filter(method -> method.isAnnotationPresent(PostMapping.class)).count() == 6); + Set postPaths = Arrays.stream(SmartDispatchController.class.getDeclaredMethods()) + .filter(method -> method.isAnnotationPresent(PostMapping.class)) + .flatMap(method -> Arrays.stream(method.getAnnotation(PostMapping.class).value())) + .collect(Collectors.toSet()); + assertEquals(Set.of("/drafts/snapshot", "/pre-arrange", "/drafts/pre-arrange", "/drafts/containers", + "/draft-locks/lock", "/draft-locks/unlock", "/draft-locks/release"), postPaths); assertTrue(Arrays.stream(SmartDispatchController.class.getDeclaredMethods()) .filter(method -> method.isAnnotationPresent(DeleteMapping.class)).count() == 1); assertTrue(Arrays.stream(SmartDispatchController.class.getDeclaredMethods())