diff --git a/src/test/groovy/org/justserve/JustServeSpec.groovy b/src/test/groovy/org/justserve/JustServeSpec.groovy index 3552b91..cc646a8 100644 --- a/src/test/groovy/org/justserve/JustServeSpec.groovy +++ b/src/test/groovy/org/justserve/JustServeSpec.groovy @@ -16,15 +16,20 @@ class JustServeSpec extends Specification { String justServeUrl, userEmail def setupSpec() { + if(System.getenv("TEST_TOKEN") == null) { + throw new IllegalStateException("TEST_TOKEN is NOT set. Define this variable for" + + "" + + " testing.") + } + if (null != System.getenv("JUSTSERVE_TOKEN")) { + throw new IllegalStateException("JUSTSERVE_TOKEN is set. Do not define this variable in testing.") + } justServeUrl = System.getenv("JUSTSERVE_URL") ?: "https://www.justserve.org" if (justServeUrl.toLowerCase().contains("dev")) { userEmail = "userc5f660c0-5c3a-42a8-bbe0-8dad54d00f42@fake.justserve.org" } else { userEmail = "jimmy@justserve.org" } - if (null != System.getenv("JUSTSERVE_TOKEN")) { - throw new IllegalStateException("JUSTSERVE_TOKEN is set. Do not define this variable in testing.") - } ctx = ApplicationContext.builder() .environments(Environment.CLI, Environment.TEST) .properties([