This is an automated email from the ASF dual-hosted git repository.
mxsm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/eventmesh.git
The following commit(s) were added to refs/heads/master by this push:
new 33721125f [ISSUE #4252] Minor refactoring for AssertUtils class (#4253)
33721125f is described below
commit 33721125fffb4ea1338a858f12b94172d581fec3
Author: HattoriHenzo <[email protected]>
AuthorDate: Tue Jul 25 11:06:25 2023 -0400
[ISSUE #4252] Minor refactoring for AssertUtils class (#4253)
* Minor refactoring for AssertUtils class
* Add end of line
* Remove useless import
* Rollback variable names
---
.../apache/eventmesh/common/utils/AssertUtils.java | 20 ++++++++++----------
.../utils/{AssertTest.java => AssertUtilsTest.java} | 4 ++--
.../http/processor/inf/AbstractEventProcessor.java | 2 +-
3 files changed, 13 insertions(+), 13 deletions(-)
diff --git
a/eventmesh-common/src/main/java/org/apache/eventmesh/common/utils/AssertUtils.java
b/eventmesh-common/src/main/java/org/apache/eventmesh/common/utils/AssertUtils.java
index 00476277d..c691da264 100644
---
a/eventmesh-common/src/main/java/org/apache/eventmesh/common/utils/AssertUtils.java
+++
b/eventmesh-common/src/main/java/org/apache/eventmesh/common/utils/AssertUtils.java
@@ -27,9 +27,9 @@ import java.util.Objects;
public final class AssertUtils {
/**
- * assert obj not null
+ * Assert obj is not null
*
- * @param obj obj
+ * @param obj Object to test
* @param message error message
*/
public static void notNull(final Object obj, final String message) {
@@ -37,24 +37,24 @@ public final class AssertUtils {
}
/**
- * assert test is true
+ * Assert condition is true
*
- * @param test test
+ * @param condition boolean to test
* @param message error message
*/
- public static void isTrue(final Boolean test, final String message) {
- if (!Boolean.TRUE.equals(test)) {
+ public static void isTrue(final Boolean condition, final String message) {
+ if (!Boolean.TRUE.equals(condition)) {
throw new IllegalArgumentException(message);
}
}
/**
- * assert str is not black
+ * Assert str is not blank
*
- * @param str str
- * @param message message
+ * @param str String to test
+ * @param message error message
*/
- public static void notBlack(final String str, final String message) {
+ public static void notBlank(final String str, final String message) {
isTrue(StringUtils.isNoneBlank(str), message);
}
diff --git
a/eventmesh-common/src/test/java/org/apache/eventmesh/common/utils/AssertTest.java
b/eventmesh-common/src/test/java/org/apache/eventmesh/common/utils/AssertUtilsTest.java
similarity index 97%
rename from
eventmesh-common/src/test/java/org/apache/eventmesh/common/utils/AssertTest.java
rename to
eventmesh-common/src/test/java/org/apache/eventmesh/common/utils/AssertUtilsTest.java
index f6b0b1d54..10f5d7828 100644
---
a/eventmesh-common/src/test/java/org/apache/eventmesh/common/utils/AssertTest.java
+++
b/eventmesh-common/src/test/java/org/apache/eventmesh/common/utils/AssertUtilsTest.java
@@ -22,7 +22,7 @@ import org.junit.Test;
/**
* test {@link AssertUtils}
*/
-public class AssertTest {
+public class AssertUtilsTest {
@Test(expected = IllegalArgumentException.class)
public void testNotNull() {
@@ -33,4 +33,4 @@ public class AssertTest {
public void testIsTrue() {
AssertUtils.isTrue(false, "error message");
}
-}
\ No newline at end of file
+}
diff --git
a/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/core/protocol/http/processor/inf/AbstractEventProcessor.java
b/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/core/protocol/http/processor/inf/AbstractEventProcessor.java
index aeb053d58..2d5e78f09 100644
---
a/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/core/protocol/http/processor/inf/AbstractEventProcessor.java
+++
b/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/core/protocol/http/processor/inf/AbstractEventProcessor.java
@@ -248,7 +248,7 @@ public abstract class AbstractEventProcessor implements
AsyncHttpProcessor {
Map<String, String> requestHeader, Map<String, Object> requestBody,
ResponseHandler<String> responseHandler) throws IOException {
AssertUtils.notNull(client, "client can't be null");
- AssertUtils.notBlack(uri, "uri can't be null");
+ AssertUtils.notBlank(uri, "uri can't be null");
AssertUtils.notNull(requestHeader, "requestParam can't be null");
AssertUtils.notNull(responseHandler, "responseHandler can't be null");
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]