You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shenyu.apache.org by GitBox <gi...@apache.org> on 2022/10/10 08:51:24 UTC
[GitHub] [shenyu] lahmXu opened a new pull request, #4064: [ISSUE #3808] Checking for empty parameter for plugins.
lahmXu opened a new pull request, #4064:
URL: https://github.com/apache/shenyu/pull/4064
About #3808
Plugins involved:
- dubbo
- sofa
- motan
- tars
- grpc
example: motan plugin
![image-20221010155833299](https://user-images.githubusercontent.com/31627887/194829564-45c92294-a0dc-471a-aff5-c68325aca9ad.png)
<!--
Thank you for proposing a pull request. This template will guide you through the essential steps necessary for a pull request.
-->
Make sure that:
- [x] You have read the [contribution guidelines](https://shenyu.apache.org/community/contributor-guide).
- [x] You submit test cases (unit or integration tests) that back your changes.
- [x] Your local test passed `./mvnw clean install -Dmaven.javadoc.skip=true`.
--
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: notifications-unsubscribe@shenyu.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shenyu] dragon-zhang merged pull request #4064: [ISSUE #3808] Checking for empty parameter for plugins.
Posted by GitBox <gi...@apache.org>.
dragon-zhang merged PR #4064:
URL: https://github.com/apache/shenyu/pull/4064
--
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: notifications-unsubscribe@shenyu.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shenyu] dragon-zhang commented on a diff in pull request #4064: [ISSUE #3808] Checking for empty parameter for plugins.
Posted by GitBox <gi...@apache.org>.
dragon-zhang commented on code in PR #4064:
URL: https://github.com/apache/shenyu/pull/4064#discussion_r991117076
##########
shenyu-common/src/test/java/org/apache/shenyu/common/utils/ParamCheckUtilsTest.java:
##########
@@ -28,11 +31,28 @@
public final class ParamCheckUtilsTest {
@Test
- public void testDubboBodyIsEmpty() {
- assertTrue(ParamCheckUtils.dubboBodyIsEmpty(null));
- assertTrue(ParamCheckUtils.dubboBodyIsEmpty(""));
- assertTrue(ParamCheckUtils.dubboBodyIsEmpty("{}"));
- assertTrue(ParamCheckUtils.dubboBodyIsEmpty("null"));
- assertFalse(ParamCheckUtils.dubboBodyIsEmpty("123"));
+ public void testBodyIsEmpty() {
+ assertTrue(ParamCheckUtils.bodyIsEmpty(null));
+ assertTrue(ParamCheckUtils.bodyIsEmpty(""));
+ assertTrue(ParamCheckUtils.bodyIsEmpty("null"));
+ assertFalse(ParamCheckUtils.bodyIsEmpty("123"));
+ }
+
+ @Test
+ public void testcheckParamsLength() {
+ try {
+ ParamCheckUtils.checkParamsLength(2, 2);
+ } catch (Exception ex) {
+ assertTrue(Objects.isNull(ex));
+ }
+ }
+
+ @Test
+ public void testcheckParamsLengthException() {
+ try {
+ ParamCheckUtils.checkParamsLength(1, 2);
+ } catch (Exception ex) {
+ assertTrue(ex instanceof ShenyuException);
+ }
Review Comment:
`org.junit.jupiter.api.Assertions#assertThrows(java.lang.Class<T>, org.junit.jupiter.api.function.Executable)` will be better.
--
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: notifications-unsubscribe@shenyu.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shenyu] dragon-zhang commented on a diff in pull request #4064: [ISSUE #3808] Checking for empty parameter for plugins.
Posted by GitBox <gi...@apache.org>.
dragon-zhang commented on code in PR #4064:
URL: https://github.com/apache/shenyu/pull/4064#discussion_r991118462
##########
shenyu-common/src/test/java/org/apache/shenyu/common/utils/ParamCheckUtilsTest.java:
##########
@@ -28,11 +31,28 @@
public final class ParamCheckUtilsTest {
@Test
- public void testDubboBodyIsEmpty() {
- assertTrue(ParamCheckUtils.dubboBodyIsEmpty(null));
- assertTrue(ParamCheckUtils.dubboBodyIsEmpty(""));
- assertTrue(ParamCheckUtils.dubboBodyIsEmpty("{}"));
- assertTrue(ParamCheckUtils.dubboBodyIsEmpty("null"));
- assertFalse(ParamCheckUtils.dubboBodyIsEmpty("123"));
+ public void testBodyIsEmpty() {
+ assertTrue(ParamCheckUtils.bodyIsEmpty(null));
+ assertTrue(ParamCheckUtils.bodyIsEmpty(""));
+ assertTrue(ParamCheckUtils.bodyIsEmpty("null"));
+ assertFalse(ParamCheckUtils.bodyIsEmpty("123"));
+ }
+
+ @Test
+ public void testcheckParamsLength() {
+ try {
+ ParamCheckUtils.checkParamsLength(2, 2);
+ } catch (Exception ex) {
+ assertTrue(Objects.isNull(ex));
+ }
Review Comment:
`org.junit.jupiter.api.Assertions#assertDoesNotThrow(org.junit.jupiter.api.function.Executable)` will be better.
--
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: notifications-unsubscribe@shenyu.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shenyu] codecov-commenter commented on pull request #4064: [ISSUE #3808] Checking for empty parameter for plugins.
Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #4064:
URL: https://github.com/apache/shenyu/pull/4064#issuecomment-1273027215
# [Codecov](https://codecov.io/gh/apache/shenyu/pull/4064?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 [#4064](https://codecov.io/gh/apache/shenyu/pull/4064?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (85ce282) into [master](https://codecov.io/gh/apache/shenyu/commit/0e766ee9c94515254e92668e4ead74b4c5b07b35?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (0e766ee) will **decrease** coverage by `0.33%`.
> The diff coverage is `60.00%`.
```diff
@@ Coverage Diff @@
## master #4064 +/- ##
============================================
- Coverage 70.10% 69.77% -0.34%
+ Complexity 6747 6722 -25
============================================
Files 935 935
Lines 25408 25465 +57
Branches 2288 2288
============================================
- Hits 17813 17767 -46
- Misses 6204 6297 +93
- Partials 1391 1401 +10
```
| [Impacted Files](https://codecov.io/gh/apache/shenyu/pull/4064?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [.../alibaba/dubbo/proxy/AlibabaDubboProxyService.java](https://codecov.io/gh/apache/shenyu/pull/4064/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-c2hlbnl1LXBsdWdpbi9zaGVueXUtcGx1Z2luLWR1YmJvL3NoZW55dS1wbHVnaW4tYWxpYmFiYS1kdWJiby9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hlbnl1L3BsdWdpbi9hbGliYWJhL2R1YmJvL3Byb3h5L0FsaWJhYmFEdWJib1Byb3h5U2VydmljZS5qYXZh) | `68.42% <0.00%> (ø)` | |
| [...in/apache/dubbo/proxy/ApacheDubboProxyService.java](https://codecov.io/gh/apache/shenyu/pull/4064/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-c2hlbnl1LXBsdWdpbi9zaGVueXUtcGx1Z2luLWR1YmJvL3NoZW55dS1wbHVnaW4tYXBhY2hlLWR1YmJvL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGVueXUvcGx1Z2luL2FwYWNoZS9kdWJiby9wcm94eS9BcGFjaGVEdWJib1Byb3h5U2VydmljZS5qYXZh) | `61.90% <0.00%> (ø)` | |
| [...e/shenyu/plugin/motan/proxy/MotanProxyService.java](https://codecov.io/gh/apache/shenyu/pull/4064/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-c2hlbnl1LXBsdWdpbi9zaGVueXUtcGx1Z2luLW1vdGFuL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGVueXUvcGx1Z2luL21vdGFuL3Byb3h5L01vdGFuUHJveHlTZXJ2aWNlLmphdmE=) | `1.81% <0.00%> (-0.04%)` | :arrow_down: |
| [...che/shenyu/plugin/sofa/proxy/SofaProxyService.java](https://codecov.io/gh/apache/shenyu/pull/4064/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-c2hlbnl1LXBsdWdpbi9zaGVueXUtcGx1Z2luLXNvZmEvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoZW55dS9wbHVnaW4vc29mYS9wcm94eS9Tb2ZhUHJveHlTZXJ2aWNlLmphdmE=) | `46.42% <0.00%> (+1.60%)` | :arrow_up: |
| [...rg/apache/shenyu/common/utils/ParamCheckUtils.java](https://codecov.io/gh/apache/shenyu/pull/4064/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-c2hlbnl1LWNvbW1vbi9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hlbnl1L2NvbW1vbi91dGlscy9QYXJhbUNoZWNrVXRpbHMuamF2YQ==) | `80.00% <100.00%> (+30.00%)` | :arrow_up: |
| [...plugin/sofa/param/SofaParamResolveServiceImpl.java](https://codecov.io/gh/apache/shenyu/pull/4064/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-c2hlbnl1LXBsdWdpbi9zaGVueXUtcGx1Z2luLXNvZmEvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoZW55dS9wbHVnaW4vc29mYS9wYXJhbS9Tb2ZhUGFyYW1SZXNvbHZlU2VydmljZUltcGwuamF2YQ==) | `50.00% <100.00%> (+1.16%)` | :arrow_up: |
| [...e/shenyu/protocol/grpc/constant/GrpcConstants.java](https://codecov.io/gh/apache/shenyu/pull/4064/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-c2hlbnl1LXByb3RvY29sL3NoZW55dS1wcm90b2NvbC1ncnBjL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGVueXUvcHJvdG9jb2wvZ3JwYy9jb25zdGFudC9HcnBjQ29uc3RhbnRzLmphdmE=) | `50.00% <100.00%> (+50.00%)` | :arrow_up: |
| [...ache/shenyu/protocol/grpc/message/JsonMessage.java](https://codecov.io/gh/apache/shenyu/pull/4064/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-c2hlbnl1LXByb3RvY29sL3NoZW55dS1wcm90b2NvbC1ncnBjL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGVueXUvcHJvdG9jb2wvZ3JwYy9tZXNzYWdlL0pzb25NZXNzYWdlLmphdmE=) | `98.61% <100.00%> (+0.01%)` | :arrow_up: |
| [.../org/apache/shenyu/plugin/divide/DividePlugin.java](https://codecov.io/gh/apache/shenyu/pull/4064/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-c2hlbnl1LXBsdWdpbi9zaGVueXUtcGx1Z2luLWRpdmlkZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hlbnl1L3BsdWdpbi9kaXZpZGUvRGl2aWRlUGx1Z2luLmphdmE=) | `60.41% <0.00%> (-30.50%)` | :arrow_down: |
| [.../client/server/consul/ShenyuConsulConfigWatch.java](https://codecov.io/gh/apache/shenyu/pull/4064/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-c2hlbnl1LXJlZ2lzdGVyLWNlbnRlci9zaGVueXUtcmVnaXN0ZXItY2xpZW50LXNlcnZlci9zaGVueXUtcmVnaXN0ZXItY2xpZW50LXNlcnZlci1jb25zdWwvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoZW55dS9yZWdpc3Rlci9jbGllbnQvc2VydmVyL2NvbnN1bC9TaGVueXVDb25zdWxDb25maWdXYXRjaC5qYXZh) | `60.41% <0.00%> (-25.00%)` | :arrow_down: |
| ... and [76 more](https://codecov.io/gh/apache/shenyu/pull/4064/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: notifications-unsubscribe@shenyu.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org