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

hefengen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shenyu.git


The following commit(s) were added to refs/heads/master by this push:
     new dc1b8042f3 Fix flaky (#5241)
dc1b8042f3 is described below

commit dc1b8042f3cf2700c0966a9c3bf9cd7f2e3b608a
Author: Tong Wang <[email protected]>
AuthorDate: Mon Oct 23 21:25:52 2023 -0500

    Fix flaky (#5241)
    
    * fixed flaky test
    
    * Fixed flaky test
    
    ---------
    
    Co-authored-by: wang3820 <wt200011>
    Co-authored-by: moremind <[email protected]>
---
 .../java/org/apache/shenyu/admin/service/PermissionServiceTest.java  | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git 
a/shenyu-admin/src/test/java/org/apache/shenyu/admin/service/PermissionServiceTest.java
 
b/shenyu-admin/src/test/java/org/apache/shenyu/admin/service/PermissionServiceTest.java
index a142ad82a5..a6c2d891c7 100644
--- 
a/shenyu-admin/src/test/java/org/apache/shenyu/admin/service/PermissionServiceTest.java
+++ 
b/shenyu-admin/src/test/java/org/apache/shenyu/admin/service/PermissionServiceTest.java
@@ -55,6 +55,7 @@ import java.util.stream.Stream;
 
 import static org.hamcrest.MatcherAssert.assertThat;
 import static org.hamcrest.Matchers.is;
+import static 
org.hamcrest.collection.IsIterableContainingInAnyOrder.containsInAnyOrder;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.mockStatic;
 import static org.mockito.Mockito.when;
@@ -151,7 +152,9 @@ public final class PermissionServiceTest {
                     Collections.singletonList(new 
PermissionMenuVO.AuthPerm("plugin:sign:modify", 
"SHENYU.BUTTON.PLUGIN.SYNCHRONIZE", null)));
             String token = 
"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJhZG1pbiIsImlhdCI6MTYxMTc5MjEzOX0.eFORUk5kZawKLTsfRYojy-uaaDySo9kWtcfgxISS_3g";
             final PermissionMenuVO result = 
permissionServiceImplUnderTest.getPermissionMenu(token);
-            assertThat(result, is(expectedResult));
+            assertThat(result.getCurrentAuth(), 
containsInAnyOrder(expectedResult.getCurrentAuth().toArray()));
+            assertThat(result.getAllAuth(), 
containsInAnyOrder(expectedResult.getAllAuth().toArray()));
+            assertThat(result.getMenu(), 
containsInAnyOrder(expectedResult.getMenu().toArray()));
         }
     }
     

Reply via email to