Skip to content

Commit cd3e09e

Browse files
Adding the new encryption endpoints to the tests
1 parent aca4204 commit cd3e09e

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

src/test/java/suite/core/CoreRefreshTest.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,26 @@ public void testCollectionRefresh_Public_Success(Core core, String urlPath, Stri
5555
}
5656
}
5757

58+
@ParameterizedTest(name = "Refresh test - UrlPath: {1} - CollectionName: {2}")
59+
@MethodSource({"suite.core.TestData#collectionEndpointArgs"})
60+
public void testCollectionRefreshCloud_Encryption_Public_Success(Core core, String urlPath, String collectionName) throws Exception {
61+
JsonNode response = core.getWithCoreApiToken(urlPath, "10000.0.1");
62+
63+
assertAll("testCollectionRefresh_Public_Success has version and collection",
64+
() -> assertNotNull(response, "Response should not be null"),
65+
() -> assertNotEquals("", response.at("/version").asText(), "Version was empty"),
66+
() -> assertNotNull(response.at("/" + collectionName), "Collection should not be null")
67+
);
68+
69+
ArrayNode nodes = (ArrayNode) response.at("/" + collectionName);
70+
for (JsonNode node : nodes) {
71+
assertTrue(JsonAssert.hasContentInFields(
72+
node, List.of("/effective", "/expires", "/location", "/size")
73+
), "Collection node was missing expected content");
74+
assertTrue(node.get("location").asText().contains("encrypted"));
75+
}
76+
}
77+
5878
@ParameterizedTest(name = "Refresh test - UrlPath: {1} - JsonPath: {2}")
5979
@MethodSource({"suite.core.TestData#optOutRefreshArgs"})
6080
public void testOptOut_LocationRefresh_Public_Success(Core core, String urlPath, String jsonPath) throws Exception {

src/test/java/suite/core/TestData.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ public static Set<Arguments> refreshArgs() {
2727
for (Core core : cores) {
2828
args.add(Arguments.of(core, "/key/acl/refresh", "keys_acl"));
2929
args.add(Arguments.of(core, "/key/refresh", "keys"));
30-
args.add(Arguments.of(core, "/client_side_keypairs/refresh", "client_side_keypairs"));
3130
}
3231

3332
return args;
@@ -41,6 +40,7 @@ public static Set<Arguments> refreshArgsEncrypted() {
4140
args.add(Arguments.of(core, "/key/keyset-keys/refresh", "keyset_keys"));
4241
args.add(Arguments.of(core, "/clients/refresh", "client_keys"));
4342
args.add(Arguments.of(core, "/sites/refresh", "sites"));
43+
args.add(Arguments.of(core, "/client_side_keypairs/refresh", "client_side_keypairs"));
4444
}
4545

4646
return args;

0 commit comments

Comments
 (0)