Skip to content

Commit d037c5d

Browse files
cYKatherineRelease Workflow
andauthored
UID2-4776 Add E2E test for remote config (#96)
* Add E2E test for remote config * Remove encrypted check * [CI Pipeline] Released Snapshot version: 4.0.1-alpha-66-SNAPSHOT --------- Co-authored-by: Release Workflow <[email protected]>
1 parent 77693b0 commit d037c5d

File tree

3 files changed

+24
-1
lines changed

3 files changed

+24
-1
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>com.uid2</groupId>
88
<artifactId>uid2-e2e</artifactId>
9-
<version>4.0.0</version>
9+
<version>4.0.1-alpha-66-SNAPSHOT</version>
1010

1111
<properties>
1212
<maven.compiler.source>21</maven.compiler.source>

src/test/java/app/component/Core.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,10 @@ public JsonNode getWithOptOutApiToken(String path) throws Exception {
4646
String response = HttpClient.get(getBaseUrl() + path, OPTOUT_API_KEY);
4747
return OBJECT_MAPPER.readTree(response);
4848
}
49+
50+
public JsonNode getOperatorConfig() throws Exception {
51+
Map<String, String> headers = new HashMap<>();
52+
String response = HttpClient.get(getBaseUrl() + "/operator/config", OPERATOR_API_KEY, headers);
53+
return OBJECT_MAPPER.readTree(response);
54+
}
4955
}

src/test/java/suite/core/CoreTest.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,21 @@ public void testAttest_ValidAttestationRequest(Core core) throws Exception {
7070
private static JsonObject getConfig() {
7171
return new JsonObject("{ \"aws_kms_jwt_signing_public_keys\": \"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmvwB41qI5Fe41PDbXqcX5uOvSvfKh8l9QV0O3M+NsB4lKqQEP0t1hfoiXTpOgKz1ArYxHsQ2LeXifX4uwEbYJFlpVM+tyQkTWQjBOw6fsLYK2Xk4X2ylNXUUf7x3SDiOVxyvTh3OZW9kqrDBN9JxSoraNLyfw0hhW0SHpfs699SehgbQ7QWep/gVlKRLIz0XAXaZNw24s79ORcQlrCE6YD0PgQmpI/dK5xMML82n6y3qcTlywlGaU7OGIMdD+CTXA3BcOkgXeqZTXNaX1u6jCTa1lvAczun6avp5VZ4TFiuPo+y4rJ3GU+14cyT5NckEcaTKSvd86UdwK5Id9tl3bQIDAQAB\"}");
7272
}
73+
74+
@ParameterizedTest(name = "/operator/config - {0}")
75+
@MethodSource({
76+
"suite.core.TestData#baseArgs"
77+
})
78+
public void testOpertorConfig_ValidRequest(Core core) throws Exception {
79+
JsonNode response = core.getOperatorConfig();
80+
81+
assertAll("testOpertorConfig_ValidRequest has valid response",
82+
() -> assertNotNull(response),
83+
() -> assertInstanceOf(Integer.class, response.get("version").asInt()),
84+
() -> {
85+
JsonNode runtimeConfig = response.get("runtime_config");
86+
assertNotNull(runtimeConfig, "runtime_config should not be null");
87+
}
88+
);
89+
}
7390
}

0 commit comments

Comments
 (0)