test(dispatch): register grouped draft in browser API boundary
This commit is contained in:
+7
-2
@@ -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<String> 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())
|
||||
|
||||
Reference in New Issue
Block a user