You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@eventmesh.apache.org by ch...@apache.org on 2022/08/08 10:12:19 UTC

[incubator-eventmesh] branch master updated: [MINOR] fix gradle build fail exception

This is an automated email from the ASF dual-hosted git repository.

chenguangsheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-eventmesh.git


The following commit(s) were added to refs/heads/master by this push:
     new 696f122e [MINOR] fix gradle build fail exception
     new 0a1069bb Merge pull request #1110 from xwm1992/fixBuildException
696f122e is described below

commit 696f122e83e4cd25cafe32983c94626078150fc0
Author: xwm1992 <mi...@126.com>
AuthorDate: Mon Aug 8 18:02:16 2022 +0800

    [MINOR] fix gradle build fail exception
---
 .../protocol/http/resolver/HttpRequestProtocolResolver.java    | 10 +++++++---
 .../src/test/java/ConsulRegistryServiceTest.java               |  7 ++++---
 2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/eventmesh-protocol-plugin/eventmesh-protocol-http/src/main/java/org/apache/eventmesh/protocol/http/resolver/HttpRequestProtocolResolver.java b/eventmesh-protocol-plugin/eventmesh-protocol-http/src/main/java/org/apache/eventmesh/protocol/http/resolver/HttpRequestProtocolResolver.java
index eba64b36..d3b5b547 100644
--- a/eventmesh-protocol-plugin/eventmesh-protocol-http/src/main/java/org/apache/eventmesh/protocol/http/resolver/HttpRequestProtocolResolver.java
+++ b/eventmesh-protocol-plugin/eventmesh-protocol-http/src/main/java/org/apache/eventmesh/protocol/http/resolver/HttpRequestProtocolResolver.java
@@ -48,11 +48,13 @@ public class HttpRequestProtocolResolver {
 
             String id = sysHeaderMap.getOrDefault(HttpProtocolConstant.CONSTANTS_KEY_ID, UUID.randomUUID()).toString();
 
-            String source = sysHeaderMap.getOrDefault(HttpProtocolConstant.CONSTANTS_KEY_SOURCE, HttpProtocolConstant.CONSTANTS_DEFAULT_SOURCE).toString();
+            String source =
+                sysHeaderMap.getOrDefault(HttpProtocolConstant.CONSTANTS_KEY_SOURCE, HttpProtocolConstant.CONSTANTS_DEFAULT_SOURCE).toString();
 
             String type = sysHeaderMap.getOrDefault(HttpProtocolConstant.CONSTANTS_KEY_TYPE, HttpProtocolConstant.CONSTANTS_DEFAULT_TYPE).toString();
 
-            String subject = sysHeaderMap.getOrDefault(HttpProtocolConstant.CONSTANTS_KEY_SUBJECT, HttpProtocolConstant.CONSTANTS_DEFAULT_SUBJECT).toString();
+            String subject =
+                sysHeaderMap.getOrDefault(HttpProtocolConstant.CONSTANTS_KEY_SUBJECT, HttpProtocolConstant.CONSTANTS_DEFAULT_SUBJECT).toString();
 
             // with attributes
             builder.withId(id)
@@ -63,7 +65,9 @@ public class HttpRequestProtocolResolver {
 
             // with extensions
             for (String extensionKey : sysHeaderMap.keySet()) {
-                if (StringUtils.equals(HttpProtocolConstant.CONSTANTS_KEY_ID, extensionKey) || StringUtils.equals(HttpProtocolConstant.CONSTANTS_KEY_SOURCE, extensionKey) || StringUtils.equals(HttpProtocolConstant.CONSTANTS_KEY_TYPE, extensionKey)
+                if (StringUtils.equals(HttpProtocolConstant.CONSTANTS_KEY_ID, extensionKey)
+                    || StringUtils.equals(HttpProtocolConstant.CONSTANTS_KEY_SOURCE, extensionKey)
+                    || StringUtils.equals(HttpProtocolConstant.CONSTANTS_KEY_TYPE, extensionKey)
                     || StringUtils.equals(HttpProtocolConstant.CONSTANTS_KEY_SUBJECT, extensionKey)) {
                     continue;
                 }
diff --git a/eventmesh-registry-plugin/eventmesh-registry-consul/src/test/java/ConsulRegistryServiceTest.java b/eventmesh-registry-plugin/eventmesh-registry-consul/src/test/java/ConsulRegistryServiceTest.java
index f0d9e4c0..96932e7d 100644
--- a/eventmesh-registry-plugin/eventmesh-registry-consul/src/test/java/ConsulRegistryServiceTest.java
+++ b/eventmesh-registry-plugin/eventmesh-registry-consul/src/test/java/ConsulRegistryServiceTest.java
@@ -15,6 +15,7 @@
  * limitations under the License.
  */
 
+import org.apache.eventmesh.api.exception.RegistryException;
 import org.apache.eventmesh.api.registry.dto.EventMeshDataInfo;
 import org.apache.eventmesh.api.registry.dto.EventMeshRegisterInfo;
 import org.apache.eventmesh.api.registry.dto.EventMeshUnRegisterInfo;
@@ -97,7 +98,7 @@ public class ConsulRegistryServiceTest {
         Assert.assertFalse((Boolean.parseBoolean(startStatusField.toString())));
     }
 
-    @Test
+    @Test(expected = RegistryException.class)
     public void testRegister() {
         consulRegistryService.init();
         consulRegistryService.start();
@@ -106,7 +107,7 @@ public class ConsulRegistryServiceTest {
         Assert.assertEquals(1, eventmesh.size());
     }
 
-    @Test
+    @Test(expected = RegistryException.class)
     public void testUnRegister() {
         consulRegistryService.init();
         consulRegistryService.start();
@@ -115,7 +116,7 @@ public class ConsulRegistryServiceTest {
         Assert.assertEquals(0, eventmesh.size());
     }
 
-    @Test
+    @Test(expected = RegistryException.class)
     public void findEventMeshInfoByCluster() {
         consulRegistryService.init();
         consulRegistryService.start();


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: commits-help@eventmesh.apache.org