Skip to content

Commit 92e1cc8

Browse files
committed
Fixed bugs
1 parent 7a3e3d4 commit 92e1cc8

File tree

8 files changed

+13
-16
lines changed

8 files changed

+13
-16
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ There are different test suites that can be run depending on the environment and
5050
| `UID2_OPERATOR_E2E_CLIENT_API_SECRET_BEFORE_OPTOUT_CUTOFF` | **Optout cutoff tests** - The API secret before the optout policy cutoff for a client to communicate with Operator |
5151
| `UID2_OPERATOR_E2E_CLIENT_API_KEY_SHARING_RECIPIENT` | **Sharing tests** - The API key with SHARER role for a client to communicate with Operator |
5252
| `UID2_OPERATOR_E2E_CLIENT_API_SECRET_SHARING_RECIPIENT` | **Sharing tests** - The API with SHARER role secret for a client to communicate with Operator |
53-
| `UID2_OPERATOR_E2E_CLIENT_API_KEY_SHARING_NON_RECIPIENT` | **Sharing tests** - The API key without SHARER role for a client to communicate with Operator |
53+
| `UID2_OPERATOR_E2E_CLIENT_API_KEY_NON_SHARING_RECIPIENT` | **Sharing tests** - The API key without SHARER role for a client to communicate with Operator |
5454
| `UID2_OPERATOR_E2E_CLIENT_API_SECRET_NON_SHARING_RECIPIENT` | **Sharing tests** - The API without SHARER role secret for a client to communicate with Operator |
5555
| `UID2_OPERATOR_E2E_CSTG_SUBSCRIPTION_ID` | **CSTG tests** - The subscription ID |
5656
| `UID2_OPERATOR_E2E_CSTG_SERVER_PUBLIC_KEY` | **CSTG tests** - The server public key |

src/test/java/app/LocalApps.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
import java.util.Set;
66

77
public final class LocalApps extends Apps {
8+
// TODO: Add optout
89
public LocalApps() {
910
super(Set.of(
1011
new Localstack("http://localhost", 5001, "Local - Localstack"),
1112
new Admin("http://localhost", 8089, "Local - Admin"),
1213
new Core("http://localhost", 8088, "Local - Core"),
1314
new Operator("http://localhost", 8888, "Local - Public Operator", Operator.Type.PUBLIC),
1415
new Operator("http://localhost", 8180, "Local - Private Operator", Operator.Type.PRIVATE),
15-
new Optout("http://localhost", 8081, "Local - Optout"),
1616
new Prometheus("http://localhost", 9085, "Local - Validator Prometheus")
1717
));
1818
}

src/test/java/app/component/Optout.java

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/test/java/common/Const.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public static final class Operator {
3131
public static final String CLIENT_API_KEY_SHARING_RECIPIENT = "UID2_OPERATOR_E2E_CLIENT_API_KEY_SHARING_RECIPIENT";
3232
public static final String CLIENT_API_SECRET_SHARING_RECIPIENT = "UID2_OPERATOR_E2E_CLIENT_API_SECRET_SHARING_RECIPIENT";
3333

34-
public static final String CLIENT_API_KEY_NON_SHARING_RECIPIENT = "UID2_OPERATOR_E2E_CLIENT_API_KEY_SHARING_NON_RECIPIENT";
34+
public static final String CLIENT_API_KEY_NON_SHARING_RECIPIENT = "UID2_OPERATOR_E2E_CLIENT_API_KEY_NON_SHARING_RECIPIENT";
3535
public static final String CLIENT_API_SECRET_NON_SHARING_RECIPIENT = "UID2_OPERATOR_E2E_CLIENT_API_SECRET_NON_SHARING_RECIPIENT";
3636

3737
// Local only - CSTG

src/test/java/common/EnvUtil.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public final class EnvUtil {
1515

1616
static {
1717
try {
18-
String args = getEnv(Const.Config.ARGS_JSON);
18+
String args = getEnv(Const.Config.ARGS_JSON, false);
1919

2020
if (StringUtils.isNotBlank(args)) {
2121
TypeReference<HashMap<String, String>> typeRef = new TypeReference<>() {
@@ -31,17 +31,21 @@ public final class EnvUtil {
3131
private EnvUtil() {
3232
}
3333

34-
public static String getEnv(String env) {
34+
public static String getEnv(String env, boolean required) {
3535
String value = System.getenv(env);
3636
if (StringUtils.isBlank(value)) {
3737
value = ARGS.get(env);
3838
}
3939

40-
if (StringUtils.isBlank(value)) {
40+
if (StringUtils.isBlank(value) && required) {
4141
LOGGER.error(() -> "Missing environment variable: " + env);
4242
System.exit(1);
4343
}
4444

4545
return value;
4646
}
47+
48+
public static String getEnv(String env) {
49+
return getEnv(env, true);
50+
}
4751
}

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

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

1313
import static org.junit.jupiter.api.Assertions.*;
1414

15-
@EnabledIf("helper.EnabledCondition#isLocal")
15+
@EnabledIf("common.EnabledCondition#isLocal")
1616
public class CoreRefreshTest {
1717
@ParameterizedTest(name = "Refresh test - UrlPath: {1} - JsonPath: {2}")
1818
@MethodSource({"suite.core.TestData#refreshArgs", "suite.core.TestData#refreshArgsEncrypted"})

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

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

1313
import static org.junit.jupiter.api.Assertions.*;
1414

15-
@EnabledIf("helper.EnabledCondition#isLocal")
15+
@EnabledIf("common.EnabledCondition#isLocal")
1616
public class CoreTest {
1717
@ParameterizedTest(name = "/attest - {0}")
1818
@MethodSource({

src/test/java/suite/operator/V2ApiOperatorLocalOnlyTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import static org.junit.jupiter.api.Assertions.assertAll;
1818
import static org.junit.jupiter.api.Assertions.assertTrue;
1919

20-
@EnabledIf("helper.EnabledCondition#isLocal")
20+
@EnabledIf("common.EnabledCondition#isLocal")
2121
public class V2ApiOperatorLocalOnlyTest {
2222
@ParameterizedTest(name = "{index} ==> Sender {0} encrypts with {1}, recipient {2} decrypts with {3}, expected result is {4}")
2323
@MethodSource({

0 commit comments

Comments
 (0)