test_class.declarator: swapper = new ConsensusReplicationRuleConfigurationYamlSwapper()
test_class.modifier: private final
test_class.original_string: private final ConsensusReplicationRuleConfigurationYamlSwapper swapper = new ConsensusReplicationRuleConfigurationYamlSwapper();
test_class.type: ConsensusReplicationRuleConfigurationYamlSwapper
test_class.var_name: swapper
test_class.declarator: logicTableName = "t_order"
test_class.modifier: private final
test_class.original_string: private final String logicTableName = "t_order";
test_class.type: String
test_class.var_name: logicTableName
test_class.declarator: dataSourceName = "demo_ds_0"
test_class.modifier: private final
test_class.original_string: private final String dataSourceName = "demo_ds_0";
test_class.type: String
test_class.var_name: dataSourceName
test_class.declarator: physicsTable = "t_order_1"
test_class.modifier: private final
test_class.original_string: private final String physicsTable = "t_order_1";
test_class.type: String
test_class.var_name: physicsTable
test_class.declarator: replicaGroupId = "raftGroupTest1"
test_class.modifier: private final
test_class.original_string: private final String replicaGroupId = "raftGroupTest1";
test_class.type: String
test_class.var_name: replicaGroupId
test_class.declarator: replicaPeers = "127.0.0.1:9090"
test_class.modifier: private final
test_class.original_string: private final String replicaPeers = "127.0.0.1:9090";
test_class.type: String
test_class.var_name: replicaPeers
test_class.file: shardingsphere-features/shardingsphere-consensus-replication/shardingsphere-consensus-replication-common/src/test/java/org/apache/shardingsphere/replication/consensus/yaml/swapper/ConsensusReplicationRuleConfigurationYamlSwapperTest.java
test_class.identifier: ConsensusReplicationRuleConfigurationYamlSwapperTest
test_case.body: @Test
      public void assertSwapToYamlConfigurationWithMaxProperties() {
          ConsensusReplicationActualTableRuleConfiguration replicaGroup = new ConsensusReplicationActualTableRuleConfiguration(physicsTable, replicaGroupId, replicaPeers, dataSourceName);
          Collection<ConsensusReplicationActualTableRuleConfiguration> replicaGroups = Collections.singleton(replicaGroup);
          ConsensusReplicationLogicTableRuleConfiguration table = new ConsensusReplicationLogicTableRuleConfiguration(logicTableName, replicaGroups);
          YamlConsensusReplicationRuleConfiguration yamlConfig = swapper.swapToYamlConfiguration(new ConsensusReplicationRuleConfiguration(Collections.singleton(table)));
          assertNotNull(yamlConfig);
          assertNotNull(yamlConfig.getTables());
          assertThat(yamlConfig.getTables().size(), is(1));
          Collection<YamlConsensusReplicationActualTableRuleConfiguration> resultReplicaGroups = yamlConfig.getTables().iterator().next().getReplicaGroups();
          assertNotNull(resultReplicaGroups);
          assertThat(resultReplicaGroups.size(), is(1));
          YamlConsensusReplicationActualTableRuleConfiguration resultReplicaGroup = resultReplicaGroups.iterator().next();
          assertThat(resultReplicaGroup.getDataSourceName(), is(dataSourceName));
          assertThat(resultReplicaGroup.getPhysicsTable(), is(physicsTable));
          assertThat(resultReplicaGroup.getReplicaGroupId(), is(replicaGroupId));
          assertThat(resultReplicaGroup.getReplicaPeers(), is(replicaPeers));
      }
test_case.class_method_signature: ConsensusReplicationRuleConfigurationYamlSwapperTest.assertSwapToYamlConfigurationWithMaxProperties()
test_case.full_signature: @Test public void assertSwapToYamlConfigurationWithMaxProperties()
test_case.identifier: assertSwapToYamlConfigurationWithMaxProperties
test_case.invocations: singleton swapToYamlConfiguration singleton assertNotNull assertNotNull getTables assertThat size getTables is getReplicaGroups next iterator getTables assertNotNull assertThat size is next iterator assertThat getDataSourceName is assertThat getPhysicsTable is assertThat getReplicaGroupId is assertThat getReplicaPeers is
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void assertSwapToYamlConfigurationWithMaxProperties()
focal_class.declarator: logicTableRuleConfigurationYamlSwapper = new ConsensusReplicationLogicTableRuleConfigurationYamlSwapper()
focal_class.modifier: private final
focal_class.original_string: private final ConsensusReplicationLogicTableRuleConfigurationYamlSwapper logicTableRuleConfigurationYamlSwapper = new ConsensusReplicationLogicTableRuleConfigurationYamlSwapper();
focal_class.type: ConsensusReplicationLogicTableRuleConfigurationYamlSwapper
focal_class.var_name: logicTableRuleConfigurationYamlSwapper
focal_class.file: shardingsphere-features/shardingsphere-consensus-replication/shardingsphere-consensus-replication-common/src/main/java/org/apache/shardingsphere/replication/consensus/yaml/swapper/ConsensusReplicationRuleConfigurationYamlSwapper.java
focal_class.identifier: ConsensusReplicationRuleConfigurationYamlSwapper
focal_class.interfaces: implements YamlRuleConfigurationSwapper<YamlConsensusReplicationRuleConfiguration, ConsensusReplicationRuleConfiguration>
focal_class.class_method_signature: ConsensusReplicationRuleConfigurationYamlSwapper.swapToYamlConfiguration(final ConsensusReplicationRuleConfiguration data)
focal_class.full_signature: @Override public YamlConsensusReplicationRuleConfiguration swapToYamlConfiguration(final ConsensusReplicationRuleConfiguration data)
focal_class.identifier: swapToYamlConfiguration
focal_class.modifiers: @Override public
focal_class.parameters: (final ConsensusReplicationRuleConfiguration data)
focal_class.return: YamlConsensusReplicationRuleConfiguration
focal_class.signature: YamlConsensusReplicationRuleConfiguration swapToYamlConfiguration(final ConsensusReplicationRuleConfiguration data)
focal_class.class_method_signature: ConsensusReplicationRuleConfigurationYamlSwapper.swapToObject(final YamlConsensusReplicationRuleConfiguration yamlConfig)
focal_class.full_signature: @Override public ConsensusReplicationRuleConfiguration swapToObject(final YamlConsensusReplicationRuleConfiguration yamlConfig)
focal_class.identifier: swapToObject
focal_class.modifiers: @Override public
focal_class.parameters: (final YamlConsensusReplicationRuleConfiguration yamlConfig)
focal_class.return: ConsensusReplicationRuleConfiguration
focal_class.signature: ConsensusReplicationRuleConfiguration swapToObject(final YamlConsensusReplicationRuleConfiguration yamlConfig)
focal_class.class_method_signature: ConsensusReplicationRuleConfigurationYamlSwapper.getTypeClass()
focal_class.full_signature: @Override public Class<ConsensusReplicationRuleConfiguration> getTypeClass()
focal_class.identifier: getTypeClass
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Class<ConsensusReplicationRuleConfiguration>
focal_class.signature: Class<ConsensusReplicationRuleConfiguration> getTypeClass()
focal_class.class_method_signature: ConsensusReplicationRuleConfigurationYamlSwapper.getRuleTagName()
focal_class.full_signature: @Override public String getRuleTagName()
focal_class.identifier: getRuleTagName
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getRuleTagName()
focal_class.class_method_signature: ConsensusReplicationRuleConfigurationYamlSwapper.getOrder()
focal_class.full_signature: @Override public int getOrder()
focal_class.identifier: getOrder
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int getOrder()
focal_method.body: @Override
      public YamlConsensusReplicationRuleConfiguration swapToYamlConfiguration(final ConsensusReplicationRuleConfiguration data) {
          Collection<YamlConsensusReplicationLogicTableRuleConfiguration> yamlTables = data.getTables().stream()
                  .map(logicTableRuleConfigurationYamlSwapper::swapToYamlConfiguration)
                  .collect(Collectors.toList());
          YamlConsensusReplicationRuleConfiguration result = new YamlConsensusReplicationRuleConfiguration();
          result.setTables(yamlTables);
          return result;
      }
focal_method.class_method_signature: ConsensusReplicationRuleConfigurationYamlSwapper.swapToYamlConfiguration(final ConsensusReplicationRuleConfiguration data)
focal_method.full_signature: @Override public YamlConsensusReplicationRuleConfiguration swapToYamlConfiguration(final ConsensusReplicationRuleConfiguration data)
focal_method.identifier: swapToYamlConfiguration
focal_method.invocations: collect map stream getTables toList setTables
focal_method.modifiers: @Override public
focal_method.parameters: (final ConsensusReplicationRuleConfiguration data)
focal_method.return: YamlConsensusReplicationRuleConfiguration
focal_method.signature: YamlConsensusReplicationRuleConfiguration swapToYamlConfiguration(final ConsensusReplicationRuleConfiguration data)