@Test
 public void testGroupConfig() {
   GroupConfig groupConfig = config.getGroupConfig();
   assertNotNull(groupConfig);
   assertEquals("spring-group", groupConfig.getName());
   assertEquals("spring-group-pass", groupConfig.getPassword());
 }
Ejemplo n.º 2
0
  public ConfigCheck createConfigCheck() {
    final ConfigCheck configCheck = new ConfigCheck();
    final GroupConfig groupConfig = config.getGroupConfig();
    final PartitionGroupConfig partitionGroupConfig = config.getPartitionGroupConfig();
    final boolean partitionGroupEnabled =
        partitionGroupConfig != null && partitionGroupConfig.isEnabled();

    PartitionGroupConfig.MemberGroupType memberGroupType =
        partitionGroupEnabled
            ? partitionGroupConfig.getGroupType()
            : PartitionGroupConfig.MemberGroupType.PER_MEMBER;
    configCheck
        .setGroupName(groupConfig.getName())
        .setGroupPassword(groupConfig.getPassword())
        .setJoinerType(joiner != null ? joiner.getType() : "")
        .setPartitionGroupEnabled(partitionGroupEnabled)
        .setMemberGroupType(memberGroupType);
    return configCheck;
  }