Class AssertionsUtil

java.lang.Object
nl.pim16aap2.testing.assertions.AssertionsUtil

public final class AssertionsUtil extends Object
A utility class for general assertions.
  • Method Details

    • assertSingletonConstructor

      public static void assertSingletonConstructor(Class<?> clazz)
      Asserts that the given class has a single constructor that is private and throws an UnsupportedOperationException when called.

      This is useful to ensure that utility classes cannot be instantiated.

      Parameters:
      clazz - The class to check.
      Throws:
      AssertionError - if the class does not have the expected constructor.