示例#1
0
 @Test
 public void constructorShouldBePrivate() {
   PrivateConstructorChecker.forClass(People.class)
       .expectedTypeOfException(AssertionError.class)
       .expectedExceptionMessage("No instances.")
       .check();
 }
示例#2
0
 @Test
 public void constructorShouldBePrivateAndThrowException() {
   PrivateConstructorChecker.forClass(Checks.class)
       .expectedTypeOfException(IllegalStateException.class)
       .expectedExceptionMessage("No instances please.")
       .check();
 }