Add hasText assertion to IpAddressMatcher constructor
Issue gh-15527
This commit is contained in:
@@ -139,4 +139,18 @@ public class IpAddressMatcherTests {
|
||||
assertThat(this.v4matcher.matches((String) null)).isFalse();
|
||||
}
|
||||
|
||||
// gh-15527
|
||||
@Test
|
||||
public void constructorWhenRequiredAddressIsNullThenThrowsIllegalArgumentException() {
|
||||
assertThatIllegalArgumentException().isThrownBy(() -> new IpAddressMatcher(null))
|
||||
.withMessage("ipAddress cannot be empty");
|
||||
}
|
||||
|
||||
// gh-15527
|
||||
@Test
|
||||
public void constructorWhenRequiredAddressIsEmptyThenThrowsIllegalArgumentException() {
|
||||
assertThatIllegalArgumentException().isThrownBy(() -> new IpAddressMatcher(""))
|
||||
.withMessage("ipAddress cannot be empty");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user