Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/test/java/com/contentstack/cms/TestClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ public class TestClient {
public static final String ENTRY_VARIANT_LOCALE =
isBlank(env.get("entryVariantLocale")) ? "en-us" : env.get("entryVariantLocale").trim();

/** Login email for tests that log in with a real account (null when {@code EMAIL} is not set in {@code .env}). */
public static final String EMAIL = env.get("EMAIL");

/** Login password for tests that log in with a real account (null when {@code PASSWORD} is not set in {@code .env}). */
public static final String PASSWORD = env.get("PASSWORD");

/** {@code true} if {@code value} is null, empty, or whitespace-only. */
private static boolean isBlank(String value) {
return value == null || value.trim().isEmpty();
Expand All @@ -51,6 +57,11 @@ public static boolean isUsingDefaultStackCredentials() {
return env.get("apiKey") == null || env.get("managementToken") == null;
}

/** {@code true} when {@code apiKey} is set to a non-blank value in {@code .env}. */
public static boolean isApiKeyConfigured() {
return !isBlank(env.get("apiKey"));
}

private static Contentstack instance;
private static Stack stackInstance;

Expand Down
Loading
Loading