From f84e1fc5bf43f9ff31491f4e8eebbc4da3614a37 Mon Sep 17 00:00:00 2001 From: YuLuo Date: Sun, 21 Jul 2024 21:03:37 +0800 Subject: [PATCH] [Improve] add unit test & fix some bugs (#2326) Signed-off-by: yuluo-yx --- .../support/valid/HostParamValidator.java | 6 +- .../vaild/EmailParamValidatorTest.java | 84 +++++++++++++++++++ .../support/vaild/HostParamValidatorTest.java | 84 +++++++++++++++++++ .../vaild/PhoneNumParamValidatorTest.java | 75 +++++++++++++++++ 4 files changed, 247 insertions(+), 2 deletions(-) create mode 100644 common/src/test/java/org/apache/hertzbeat/common/support/vaild/EmailParamValidatorTest.java create mode 100644 common/src/test/java/org/apache/hertzbeat/common/support/vaild/HostParamValidatorTest.java create mode 100644 common/src/test/java/org/apache/hertzbeat/common/support/vaild/PhoneNumParamValidatorTest.java diff --git a/common/src/main/java/org/apache/hertzbeat/common/support/valid/HostParamValidator.java b/common/src/main/java/org/apache/hertzbeat/common/support/valid/HostParamValidator.java index c0e7deab344..a30e1c26a8a 100644 --- a/common/src/main/java/org/apache/hertzbeat/common/support/valid/HostParamValidator.java +++ b/common/src/main/java/org/apache/hertzbeat/common/support/valid/HostParamValidator.java @@ -34,11 +34,13 @@ public class HostParamValidator implements ConstraintValidator