File tree Expand file tree Collapse file tree 1 file changed +22
-5
lines changed Expand file tree Collapse file tree 1 file changed +22
-5
lines changed Original file line number Diff line number Diff line change 11# UtilsVerifier
2- UtilsVerifier is a pure java library that can be used in junit tests to verify that Utility method is properly defined.
2+ UtilsVerifier is a pure Java library that can be used in Junit tests to verify that Utility class is properly defined.
33
44[ ![ Build Status] ( https://travis-ci.org/karczews/UtilsVerifier.svg?branch=master )] ( https://travis-ci.org/karczews/UtilsVerifier )
55[ ![ Sonatype Nexus (Releases)] ( https://img.shields.io/nexus/r/https/oss.sonatype.org/com.github.karczews/utilsverifier.svg?style=flat )] ( https://oss.sonatype.org/content/repositories/releases/com/github/karczews/utilsverifier/ )
@@ -8,17 +8,34 @@ UtilsVerifier is a pure java library that can be used in junit tests to verify t
88[ ![ License] ( https://img.shields.io/badge/license-Apache%202.0-blue.svg )] ( https://github.com/karczews/UtilsVerifier/blob/master/LICENSE )
99
1010By default verification includes:
11- * class has only one private constructor
12- * class is final
13- * class has no instance fields
14- * class has no instance methods
11+ * class having only one private constructor
12+ * class being final
13+ * class having no instance fields
14+ * class having no instance methods
15+ * class having no static mutable fields
1516
1617Usage
1718--------
1819``` java
1920 UtilsVerifier . forClass(ClassToTest . class). verify();
2021```
2122
23+ It's possible to disable one or more of the default verification checks by using set of "suppress" methods.
24+
25+ ``` java
26+ UtilsVerifier . forClass(ClassToTest . class)
27+ .suppressFinalClassCheck(true )
28+ .suppressOnlyOneConstructorCheck(true )
29+ .verify();
30+ ```
31+
32+ If the tested class constructor should throw an exception when used it's possible to specify the type of the exception.
33+
34+ ``` java
35+ UtilsVerifier . forClass(ClassToTest . class)
36+ .withConstructorThrowing(DesiredException . class)
37+ .verify();
38+ ```
2239
2340Download
2441--------
You can’t perform that action at this time.
0 commit comments