You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@eventmesh.apache.org by GitBox <gi...@apache.org> on 2022/12/08 02:55:51 UTC

[GitHub] [incubator-eventmesh] jonyangx opened a new pull request, #2502: [ISSUE #858] Add test code for this module [eventmesh-security-plugin]

jonyangx opened a new pull request, #2502:
URL: https://github.com/apache/incubator-eventmesh/pull/2502

   
   Fixes #858 .
   
   ### Motivation
   
   Add test code for eventmesh-security-plugin module.
   
   
   ### Modifications
   
   | Task Status | Class | Type |
   | :-----: | :----- | :----- |
   | √  | org/apache/eventmesh/acl/impl/AclServiceImpl.java | service |
   | √  | org/apache/eventmesh/api/acl/AclService.java | service |
   | √  | org/apache/eventmesh/api/auth/AuthService.java | service |
   | √  | org/apache/eventmesh/api/common/ConfigurationWrapper.java | common |
   | √  | org/apache/eventmesh/auth/http/basic/config/AuthConfigs.java | config |
   | √  | org/apache/eventmesh/api/exception/AclException.java | exception |
   | √  | org/apache/eventmesh/auth/http/basic/impl/AuthHttpBasicService.java | service |
   
   ### Documentation
   
   - Does this pull request introduce a new feature? (no)
   - If yes, how is the feature documented? (not documented)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [incubator-eventmesh] codecov[bot] commented on pull request #2502: [ISSUE #858] Add test code for this module [eventmesh-security-plugin]

Posted by GitBox <gi...@apache.org>.
codecov[bot] commented on PR #2502:
URL: https://github.com/apache/incubator-eventmesh/pull/2502#issuecomment-1342264259

   # [Codecov](https://codecov.io/gh/apache/incubator-eventmesh/pull/2502?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#2502](https://codecov.io/gh/apache/incubator-eventmesh/pull/2502?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (03a4fbd) into [master](https://codecov.io/gh/apache/incubator-eventmesh/commit/12fb28ec71cc3e68c9bfb3b0e6ae0e1148020873?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (12fb28e) will **increase** coverage by `0.12%`.
   > The diff coverage is `62.96%`.
   
   > :exclamation: Current head 03a4fbd differs from pull request most recent head d0f073d. Consider uploading reports for the commit d0f073d to get more accurate results
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #2502      +/-   ##
   ============================================
   + Coverage     11.79%   11.91%   +0.12%     
   - Complexity      904      927      +23     
   ============================================
     Files           469      476       +7     
     Lines         27801    27840      +39     
     Branches       3016     3014       -2     
   ============================================
   + Hits           3278     3317      +39     
   + Misses        24228    24226       -2     
   - Partials        295      297       +2     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-eventmesh/pull/2502?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...nt/tcp/impl/cloudevent/CloudEventTCPSubClient.java](https://codecov.io/gh/apache/incubator-eventmesh/pull/2502/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXZlbnRtZXNoLXNkay1qYXZhL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9ldmVudG1lc2gvY2xpZW50L3RjcC9pbXBsL2Nsb3VkZXZlbnQvQ2xvdWRFdmVudFRDUFN1YkNsaWVudC5qYXZh) | `5.88% <0.00%> (-0.18%)` | :arrow_down: |
   | [...g/apache/eventmesh/api/exception/AclException.java](https://codecov.io/gh/apache/incubator-eventmesh/pull/2502/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXZlbnRtZXNoLXNlY3VyaXR5LXBsdWdpbi9ldmVudG1lc2gtc2VjdXJpdHktYXBpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9ldmVudG1lc2gvYXBpL2V4Y2VwdGlvbi9BY2xFeGNlcHRpb24uamF2YQ==) | `100.00% <ø> (ø)` | |
   | [.../apache/eventmesh/api/exception/AuthException.java](https://codecov.io/gh/apache/incubator-eventmesh/pull/2502/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXZlbnRtZXNoLXNlY3VyaXR5LXBsdWdpbi9ldmVudG1lc2gtc2VjdXJpdHktYXBpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9ldmVudG1lc2gvYXBpL2V4Y2VwdGlvbi9BdXRoRXhjZXB0aW9uLmphdmE=) | `0.00% <ø> (ø)` | |
   | [...che/eventmesh/api/common/ConfigurationWrapper.java](https://codecov.io/gh/apache/incubator-eventmesh/pull/2502/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXZlbnRtZXNoLXNlY3VyaXR5LXBsdWdpbi9ldmVudG1lc2gtc2VjdXJpdHktYXBpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9ldmVudG1lc2gvYXBpL2NvbW1vbi9Db25maWd1cmF0aW9uV3JhcHBlci5qYXZh) | `69.23% <66.66%> (ø)` | |
   | [.../eventmesh/auth/http/basic/config/AuthConfigs.java](https://codecov.io/gh/apache/incubator-eventmesh/pull/2502/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXZlbnRtZXNoLXNlY3VyaXR5LXBsdWdpbi9ldmVudG1lc2gtc2VjdXJpdHktYXV0aC1odHRwLWJhc2ljL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9ldmVudG1lc2gvYXV0aC9odHRwL2Jhc2ljL2NvbmZpZy9BdXRoQ29uZmlncy5qYXZh) | `81.81% <80.00%> (ø)` | |
   | [...onnector/rabbitmq/config/ConfigurationWrapper.java](https://codecov.io/gh/apache/incubator-eventmesh/pull/2502/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXZlbnRtZXNoLWNvbm5lY3Rvci1wbHVnaW4vZXZlbnRtZXNoLWNvbm5lY3Rvci1yYWJiaXRtcS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvZXZlbnRtZXNoL2Nvbm5lY3Rvci9yYWJiaXRtcS9jb25maWcvQ29uZmlndXJhdGlvbldyYXBwZXIuamF2YQ==) | `61.11% <100.00%> (+8.47%)` | :arrow_up: |
   | [.../apache/eventmesh/runtime/util/RemotingHelper.java](https://codecov.io/gh/apache/incubator-eventmesh/pull/2502/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXZlbnRtZXNoLXJ1bnRpbWUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2V2ZW50bWVzaC9ydW50aW1lL3V0aWwvUmVtb3RpbmdIZWxwZXIuamF2YQ==) | `55.55% <100.00%> (+0.38%)` | :arrow_up: |
   | [...esh/auth/http/basic/impl/AuthHttpBasicService.java](https://codecov.io/gh/apache/incubator-eventmesh/pull/2502/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXZlbnRtZXNoLXNlY3VyaXR5LXBsdWdpbi9ldmVudG1lc2gtc2VjdXJpdHktYXV0aC1odHRwLWJhc2ljL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9ldmVudG1lc2gvYXV0aC9odHRwL2Jhc2ljL2ltcGwvQXV0aEh0dHBCYXNpY1NlcnZpY2UuamF2YQ==) | `84.61% <100.00%> (ø)` | |
   | [.../admin/handler/QueryRecommendEventMeshHandler.java](https://codecov.io/gh/apache/incubator-eventmesh/pull/2502/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXZlbnRtZXNoLXJ1bnRpbWUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2V2ZW50bWVzaC9ydW50aW1lL2FkbWluL2hhbmRsZXIvUXVlcnlSZWNvbW1lbmRFdmVudE1lc2hIYW5kbGVyLmphdmE=) | `88.88% <0.00%> (-3.71%)` | :arrow_down: |
   | [.../trace/pinpoint/exporter/PinpointSpanExporter.java](https://codecov.io/gh/apache/incubator-eventmesh/pull/2502/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXZlbnRtZXNoLXRyYWNlLXBsdWdpbi9ldmVudG1lc2gtdHJhY2UtcGlucG9pbnQvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2V2ZW50bWVzaC90cmFjZS9waW5wb2ludC9leHBvcnRlci9QaW5wb2ludFNwYW5FeHBvcnRlci5qYXZh) | `68.24% <0.00%> (-0.68%)` | :arrow_down: |
   | ... and [15 more](https://codecov.io/gh/apache/incubator-eventmesh/pull/2502/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [incubator-eventmesh] jonyangx merged pull request #2502: [ISSUE #858] Add test code for this module [eventmesh-security-plugin]

Posted by GitBox <gi...@apache.org>.
jonyangx merged PR #2502:
URL: https://github.com/apache/incubator-eventmesh/pull/2502


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [incubator-eventmesh] horoc commented on a diff in pull request #2502: [ISSUE #858] Add test code for this module [eventmesh-security-plugin]

Posted by GitBox <gi...@apache.org>.
horoc commented on code in PR #2502:
URL: https://github.com/apache/incubator-eventmesh/pull/2502#discussion_r1045189122


##########
eventmesh-security-plugin/eventmesh-security-api/src/test/java/org/apache/eventmesh/api/common/ConfigurationWrapperTest.java:
##########
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.api.common;
+
+import java.io.File;
+import java.net.URL;
+import java.util.Properties;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+public class ConfigurationWrapperTest {
+
+    @Test
+    public void testGetDefaultConfig() {
+        try {
+            URL resource = Thread.currentThread().getContextClassLoader().getResource("test.properties");
+            String filePath = resource.getPath();
+            File f = new File(filePath);
+            String path = f.getParent();
+            System.setProperty("confPath", path + File.separator + "1");

Review Comment:
   maybe we can use a more elegant test property file path instead of `/resources/1` here?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [incubator-eventmesh] jonyangx commented on pull request #2502: [ISSUE #858] Add test code for this module [eventmesh-security-plugin]

Posted by GitBox <gi...@apache.org>.
jonyangx commented on PR #2502:
URL: https://github.com/apache/incubator-eventmesh/pull/2502#issuecomment-1346183866

   > @jonyangx please fix the license check error, two properties files missing the apache header.
   
   Done. Thanks.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [incubator-eventmesh] jonyangx commented on a diff in pull request #2502: [ISSUE #858] Add test code for this module [eventmesh-security-plugin]

Posted by GitBox <gi...@apache.org>.
jonyangx commented on code in PR #2502:
URL: https://github.com/apache/incubator-eventmesh/pull/2502#discussion_r1045195471


##########
eventmesh-security-plugin/eventmesh-security-api/src/test/java/org/apache/eventmesh/api/common/ConfigurationWrapperTest.java:
##########
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.api.common;
+
+import java.io.File;
+import java.net.URL;
+import java.util.Properties;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+public class ConfigurationWrapperTest {
+
+    @Test
+    public void testGetDefaultConfig() {
+        try {
+            URL resource = Thread.currentThread().getContextClassLoader().getResource("test.properties");
+            String filePath = resource.getPath();
+            File f = new File(filePath);
+            String path = f.getParent();
+            System.setProperty("confPath", path + File.separator + "1");

Review Comment:
   Thanks!
   I refactor it.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [incubator-eventmesh] jonyangx commented on a diff in pull request #2502: [ISSUE #858] Add test code for this module [eventmesh-security-plugin]

Posted by GitBox <gi...@apache.org>.
jonyangx commented on code in PR #2502:
URL: https://github.com/apache/incubator-eventmesh/pull/2502#discussion_r1045195522


##########
eventmesh-security-plugin/eventmesh-security-api/src/test/java/org/apache/eventmesh/api/common/ConfigurationWrapperTest.java:
##########
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.api.common;
+
+import java.io.File;
+import java.net.URL;
+import java.util.Properties;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+public class ConfigurationWrapperTest {
+
+    @Test
+    public void testGetDefaultConfig() {
+        try {
+            URL resource = Thread.currentThread().getContextClassLoader().getResource("test.properties");
+            String filePath = resource.getPath();
+            File f = new File(filePath);
+            String path = f.getParent();
+            System.setProperty("confPath", path + File.separator + "1");

Review Comment:
   @horoc done.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [incubator-eventmesh] xwm1992 commented on pull request #2502: [ISSUE #858] Add test code for this module [eventmesh-security-plugin]

Posted by GitBox <gi...@apache.org>.
xwm1992 commented on PR #2502:
URL: https://github.com/apache/incubator-eventmesh/pull/2502#issuecomment-1345803160

   @jonyangx please fix the license check error, two properties files missing the apache header.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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