Class AssertionsUtil
java.lang.Object
nl.pim16aap2.testing.assertions.AssertionsUtil
A utility class for general assertions.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidassertSingletonConstructor(Class<?> clazz) Asserts that the given class has a single constructor that is private and throws an UnsupportedOperationException when called.
-
Method Details
-
assertSingletonConstructor
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.
-