@@ -88,14 +88,46 @@ public class ArchitectureTest {
8888 .should ().dependOnClassesThat ().resideInAnyPackage ("java.awt.." );
8989
9090 /**
91- * Do not use org.apache.commons.lang3.StringUtils.
91+ * Do not use org.apache.commons.lang3.StringUtils.isEmpty(CharSequence).
9292 */
9393 @ ArchTest
94- public static final ArchRule apacheStringUtilsPackageRule = noClasses ()
95- .that ()
96- .doNotHaveFullyQualifiedName ("org.htmlunit.HttpWebConnection" )
97- .and ().doNotHaveFullyQualifiedName ("org.htmlunit.util.StringUtils" )
98- .should ().dependOnClassesThat ().haveFullyQualifiedName ("org.apache.commons.lang3.StringUtils" );
94+ public static final ArchRule apacheStringUtilsIsEmptyRule = noClasses ()
95+ .should ().callMethod (org .apache .commons .lang3 .StringUtils .class , "isEmpty" , CharSequence .class );
96+
97+ /**
98+ * Do not use org.apache.commons.lang3.StringUtils.isBlank(CharSequence).
99+ */
100+ @ ArchTest
101+ public static final ArchRule apacheStringUtilsIsBlankRule = noClasses ()
102+ .should ().callMethod (org .apache .commons .lang3 .StringUtils .class , "isBlank" , CharSequence .class );
103+
104+ /**
105+ * Do not use org.apache.commons.lang3.StringUtils.isNotBlank(CharSequence).
106+ */
107+ @ ArchTest
108+ public static final ArchRule apacheStringUtilsIsNotBlankRule = noClasses ()
109+ .should ().callMethod (org .apache .commons .lang3 .StringUtils .class , "isNotBlank" , CharSequence .class );
110+
111+ /**
112+ * Do not use org.apache.commons.lang3.Strings.startsWith(CharSequence, CharSequence).
113+ */
114+ @ ArchTest
115+ public static final ArchRule apacheStringsStartsWithRule = noClasses ()
116+ .should ().callMethod (org .apache .commons .lang3 .Strings .class , "startsWith" , CharSequence .class , CharSequence .class );
117+
118+ /**
119+ * Do not use org.apache.commons.lang3.Strings.endsWith(CharSequence, CharSequence).
120+ */
121+ @ ArchTest
122+ public static final ArchRule apacheStringsEndsWithRule = noClasses ()
123+ .should ().callMethod (org .apache .commons .lang3 .Strings .class , "endsWith" , CharSequence .class , CharSequence .class );
124+
125+ /**
126+ * Do not use org.apache.commons.lang3.Strings.contains(CharSequence, CharSequence).
127+ */
128+ @ ArchTest
129+ public static final ArchRule apacheStringsContainsRule = noClasses ()
130+ .should ().callMethod (org .apache .commons .lang3 .Strings .class , "contains" , CharSequence .class , CharSequence .class );
99131
100132 /**
101133 * The jetty websocket stuff is only used by one class.
0 commit comments