use of io.shardingjdbc.core.api.config.strategy.HintShardingStrategyConfiguration in project sharding-jdbc by shardingjdbc.
the class ShardingRuleConfigurationConverterTest method assertFromJsonForHintStrategy.
@Test
public void assertFromJsonForHintStrategy() {
ShardingRuleConfiguration actual = ShardingRuleConfigurationConverter.fromJson(getJsonForHintStrategy());
assertCommon(actual);
HintShardingStrategyConfiguration actualShardingStrategy = (HintShardingStrategyConfiguration) actual.getDefaultTableShardingStrategyConfig();
assertThat(actualShardingStrategy.getShardingAlgorithm(), instanceOf(TestHintShardingAlgorithm.class));
}
use of io.shardingjdbc.core.api.config.strategy.HintShardingStrategyConfiguration in project sharding-jdbc by shardingjdbc.
the class ShardingRuleConfigurationConverterTest method assertToJsonForHintStrategy.
@Test
public void assertToJsonForHintStrategy() {
HintShardingStrategyConfiguration actual = new HintShardingStrategyConfiguration(new TestHintShardingAlgorithm());
assertThat(ShardingRuleConfigurationConverter.toJson(getCommonShardingRuleConfig(actual)), is(getJsonForHintStrategy()));
}
use of io.shardingjdbc.core.api.config.strategy.HintShardingStrategyConfiguration in project sharding-jdbc by shardingjdbc.
the class ShardingNamespaceTest method assertHintStrategy.
@Test
public void assertHintStrategy() {
HintShardingStrategyConfiguration hintStrategy = this.applicationContext.getBean("hintStrategy", HintShardingStrategyConfiguration.class);
assertThat(hintStrategy.getShardingAlgorithm(), instanceOf(DefaultHintShardingAlgorithm.class));
}
Aggregations