Search in sources :

Example 1 with TestPreciseShardingAlgorithm

use of io.shardingjdbc.orchestration.internal.json.fixture.TestPreciseShardingAlgorithm in project sharding-jdbc by shardingjdbc.

the class ShardingRuleConfigurationConverterTest method assertToJsonForStandardStrategy.

@Test
public void assertToJsonForStandardStrategy() {
    StandardShardingStrategyConfiguration actual = new StandardShardingStrategyConfiguration("order_id", new TestPreciseShardingAlgorithm(), new TestRangeShardingAlgorithm());
    assertThat(ShardingRuleConfigurationConverter.toJson(getCommonShardingRuleConfig(actual)), is(getJsonForStandardStrategy()));
}
Also used : StandardShardingStrategyConfiguration(io.shardingjdbc.core.api.config.strategy.StandardShardingStrategyConfiguration) TestPreciseShardingAlgorithm(io.shardingjdbc.orchestration.internal.json.fixture.TestPreciseShardingAlgorithm) TestRangeShardingAlgorithm(io.shardingjdbc.orchestration.internal.json.fixture.TestRangeShardingAlgorithm) Test(org.junit.Test)

Aggregations

StandardShardingStrategyConfiguration (io.shardingjdbc.core.api.config.strategy.StandardShardingStrategyConfiguration)1 TestPreciseShardingAlgorithm (io.shardingjdbc.orchestration.internal.json.fixture.TestPreciseShardingAlgorithm)1 TestRangeShardingAlgorithm (io.shardingjdbc.orchestration.internal.json.fixture.TestRangeShardingAlgorithm)1 Test (org.junit.Test)1