client/java: add browseChildrenRejectsRepeatedPageToken test for parity
This commit is contained in:
+21
@@ -203,6 +203,27 @@ final class GalaxyRepositoryClientTests {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void browseChildrenRejectsRepeatedPageToken() throws Exception {
|
||||||
|
// Queue the same BrowseChildrenReply twice with a non-empty NextPageToken.
|
||||||
|
// The client will request a second page and detect that the token repeats.
|
||||||
|
BrowseChildrenService service = new BrowseChildrenService();
|
||||||
|
BrowseChildrenReply repeatedReply = browseReply(
|
||||||
|
List.of(obj(1, "Plant", true)),
|
||||||
|
List.of(true),
|
||||||
|
1L,
|
||||||
|
"1:abc:1");
|
||||||
|
service.replies.add(repeatedReply);
|
||||||
|
service.replies.add(repeatedReply);
|
||||||
|
|
||||||
|
try (InProcessGalaxy g = InProcessGalaxy.start(service, new AtomicReference<>());
|
||||||
|
GalaxyRepositoryClient client = g.client("")) {
|
||||||
|
MxGatewayException error = assertThrows(MxGatewayException.class, client::browse);
|
||||||
|
|
||||||
|
assertTrue(error.getMessage().contains("repeated page token"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void watchDeployEventsReceivesEventsInOrder() throws Exception {
|
void watchDeployEventsReceivesEventsInOrder() throws Exception {
|
||||||
DeployEvent first = DeployEvent.newBuilder()
|
DeployEvent first = DeployEvent.newBuilder()
|
||||||
|
|||||||
Reference in New Issue
Block a user