Skip to content

Commit 919ac0c

Browse files
Change E2E logic to add header instead
1 parent f1b07fd commit 919ac0c

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,13 @@ public JsonNode attest(String attestationRequest) throws Exception {
2828
}
2929

3030
public JsonNode getWithCoreApiToken(String path) throws Exception {
31-
return getWithCoreApiToken(path, "0.0.0");
31+
return getWithCoreApiToken(path, false);
3232
}
3333

34-
public JsonNode getWithCoreApiToken(String path, String operatorVersion) throws Exception {
34+
public JsonNode getWithCoreApiToken(String path, boolean encrypted) throws Exception {
3535
Map<String, String> headers = new HashMap<>();
36-
headers.put("X-UID2-AppVersion", "uid2-operator=" + operatorVersion);
36+
if (encrypted)
37+
headers.put("Encrypted", "true");
3738
String response = HttpClient.get(getBaseUrl() + path, CORE_API_TOKEN, headers);
3839
return Mapper.OBJECT_MAPPER.readTree(response);
3940
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class CoreRefreshTest {
1515
@ParameterizedTest(name = "Refresh test - UrlPath: {1} - JsonPath: {2}")
1616
@MethodSource({"suite.core.TestData#refreshArgs", "suite.core.TestData#refreshArgsEncrypted"})
1717
public void testLocationRefresh_Public_Success(Core core, String urlPath, String jsonPath) throws Exception {
18-
JsonNode response = core.getWithCoreApiToken(urlPath, "5.0.1");
18+
JsonNode response = core.getWithCoreApiToken(urlPath);
1919

2020
assertAll("testLocationRefresh_Public_Success has version and location",
2121
() -> assertNotNull(response),
@@ -27,7 +27,7 @@ public void testLocationRefresh_Public_Success(Core core, String urlPath, String
2727
@ParameterizedTest(name = "Refresh test - UrlPath: {1} - JsonPath: {2}")
2828
@MethodSource({"suite.core.TestData#refreshArgsEncrypted"})
2929
public void testLocationRefreshCloudEncryption_Public_Success(Core core, String urlPath, String jsonPath) throws Exception {
30-
JsonNode response = core.getWithCoreApiToken(urlPath, "10000.0.1");
30+
JsonNode response = core.getWithCoreApiToken(urlPath, true);
3131

3232
assertAll("testLocationRefresh_Public_Success has version and location",
3333
() -> assertNotNull(response),
@@ -58,7 +58,7 @@ public void testCollectionRefresh_Public_Success(Core core, String urlPath, Stri
5858
@ParameterizedTest(name = "Refresh test - UrlPath: {1} - CollectionName: {2}")
5959
@MethodSource({"suite.core.TestData#collectionEndpointArgs"})
6060
public void testCollectionRefreshCloud_Encryption_Public_Success(Core core, String urlPath, String collectionName) throws Exception {
61-
JsonNode response = core.getWithCoreApiToken(urlPath, "10000.0.1");
61+
JsonNode response = core.getWithCoreApiToken(urlPath, true);
6262

6363
assertAll("testCollectionRefresh_Public_Success has version and collection",
6464
() -> assertNotNull(response, "Response should not be null"),

0 commit comments

Comments
 (0)