test(dispatch): align read boundary with capacity demand endpoint

This commit is contained in:
2026-10-22 15:13:57 +08:00
parent fc25507915
commit 56f2853fb7
@@ -58,8 +58,13 @@ class Phase4BrowserApiBoundaryTest {
assertTrue(condition != null);
assertTrue(Arrays.asList(condition.name()).contains("lastleg.dispatch-query-api.enabled"));
assertFalse(condition.matchIfMissing());
assertTrue(Arrays.stream(DispatchQueryController.class.getDeclaredMethods())
.filter(method -> method.isAnnotationPresent(GetMapping.class)).count() == 3);
Set<String> readPaths = Arrays.stream(DispatchQueryController.class.getDeclaredMethods())
.filter(method -> method.isAnnotationPresent(GetMapping.class))
.flatMap(method -> {
String[] values = method.getAnnotation(GetMapping.class).value();
return values.length == 0 ? java.util.stream.Stream.of("") : Arrays.stream(values);
}).collect(Collectors.toSet());
assertEquals(Set.of("", "/capacity-demands", "/{dispatchNo}", "/{dispatchNo}/prints/bol"), readPaths);
assertFalse(Arrays.stream(DispatchQueryController.class.getDeclaredMethods())
.flatMap(method -> Arrays.stream(method.getAnnotations()))
.anyMatch(annotation -> Set.of("PostMapping", "PutMapping", "DeleteMapping")