You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by zh...@apache.org on 2022/11/23 00:30:37 UTC

[rocketmq-dashboard] branch master updated: Fix flaky testList (#120)

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

zhangjidi2016 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/rocketmq-dashboard.git


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

commit fc9781e6fc11678e1b35c2f6fead97f6d37580fc
Author: yannizhou05 <61...@users.noreply.github.com>
AuthorDate: Tue Nov 22 18:30:31 2022 -0600

    Fix flaky testList (#120)
---
 .../org/apache/rocketmq/dashboard/controller/TopicControllerTest.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/test/java/org/apache/rocketmq/dashboard/controller/TopicControllerTest.java b/src/test/java/org/apache/rocketmq/dashboard/controller/TopicControllerTest.java
index abe6ac7..6b5cb56 100644
--- a/src/test/java/org/apache/rocketmq/dashboard/controller/TopicControllerTest.java
+++ b/src/test/java/org/apache/rocketmq/dashboard/controller/TopicControllerTest.java
@@ -54,6 +54,7 @@ import org.springframework.http.MediaType;
 import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
 
 import static org.hamcrest.Matchers.hasSize;
+import static org.hamcrest.Matchers.containsInAnyOrder;
 import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.ArgumentMatchers.anyBoolean;
 import static org.mockito.ArgumentMatchers.anyLong;
@@ -135,8 +136,9 @@ public class TopicControllerTest extends BaseControllerTest {
         // 3、filter system topic
         requestBuilder = MockMvcRequestBuilders.get(url);
         perform = mockMvc.perform(requestBuilder);
+        String[] topicString = {"%SYS%system_topic2","common_topic2","%SYS%system_topic1","common_topic1"};
         perform.andExpect(status().isOk())
-            .andExpect(jsonPath("$.data.topicList[2]").value("%SYS%system_topic1"));
+            .andExpect(jsonPath("$.data.topicList").value(containsInAnyOrder(topicString)));
     }
 
     @Test