[ISSUE #25]Add filter in consumer list. (#26)

Co-authored-by: zhangjidi <zhangjidi@cmss.chinamobile.com>
This commit is contained in:
zhangjidi2016
2021-10-09 18:56:58 +08:00
committed by GitHub
parent d0583b73c3
commit cc30bb2373
10 changed files with 255 additions and 194 deletions

View File

@@ -92,7 +92,7 @@ public class ConsumerControllerTest extends BaseControllerTest {
requestBuilder = MockMvcRequestBuilders.get(url);
perform = mockMvc.perform(requestBuilder);
perform.andExpect(status().isOk())
.andExpect(jsonPath("$.data", hasSize(1)))
.andExpect(jsonPath("$.data", hasSize(2)))
.andExpect(jsonPath("$.data[0].group").value("group_test"))
.andExpect(jsonPath("$.data[0].consumeType").value(ConsumeType.CONSUME_ACTIVELY.name()))
.andExpect(jsonPath("$.data[0].messageModel").value(MessageModel.CLUSTERING.name()));

View File

@@ -135,10 +135,13 @@ public class MockObjectUtil {
public static SubscriptionGroupWrapper createSubscriptionGroupWrapper() {
SubscriptionGroupWrapper wrapper = new SubscriptionGroupWrapper();
ConcurrentMap<String, SubscriptionGroupConfig> subscriptionGroupTable = new ConcurrentHashMap(2);
SubscriptionGroupConfig config = new SubscriptionGroupConfig();
config.setGroupName("group_test");
ConcurrentMap<String, SubscriptionGroupConfig> subscriptionGroupTable = new ConcurrentHashMap(2);
subscriptionGroupTable.put("group_test", config);
SubscriptionGroupConfig sysGroupConfig = new SubscriptionGroupConfig();
sysGroupConfig.setGroupName(MixAll.TOOLS_CONSUMER_GROUP);
subscriptionGroupTable.put(MixAll.TOOLS_CONSUMER_GROUP, sysGroupConfig);
wrapper.setSubscriptionGroupTable(subscriptionGroupTable);
wrapper.setDataVersion(new DataVersion());
return wrapper;