Java Assert assertEnvVarPresent(String envVarKey, String errorMessage)

Here you can find the source of assertEnvVarPresent(String envVarKey, String errorMessage)

Description

assert Env Var Present

License

Open Source License

Declaration

private static void assertEnvVarPresent(String envVarKey, String errorMessage) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    private static void assertEnvVarPresent(String envVarKey, String errorMessage) {
        if (System.getenv(envVarKey) == null) {
            throw new IllegalArgumentException(errorMessage);
        }/*from w  w  w . jav  a 2  s .c  om*/
    }
}

Related

  1. assertDescriptorName(String key)
  2. assertDidNotThrow(final Runnable r)
  3. assertDifferentInstance(final Object o1, final Object o2)
  4. assertDotted(String name)
  5. assertEntryCount(final long entryCount)
  6. assertException(Runnable task, Class clazz)
  7. assertFact(boolean truth, String failure)
  8. assertFailed(Object expression, Object message)
  9. assertFails(Class expectedThrowable, String pattern, int... values)