Skip to content

Commit 2d26ac2

Browse files
Merge pull request #60 from IABTechLab/abu-UID2-5161
Change to pass encrypted in header
2 parents f1b07fd + 67612a0 commit 2d26ac2

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

pom.xml

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

88
<groupId>com.uid2</groupId>
99
<artifactId>uid2-e2e</artifactId>
10-
<version>3.1.0</version>
10+
<version>3.1.1-alpha-31-SNAPSHOT</version>
1111
<properties>
1212
<maven.compiler.source>21</maven.compiler.source>
1313
<maven.compiler.target>21</maven.compiler.target>

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)