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())