@Override
    public String route(final ReadwriteSplittingDataSourceGroupRule rule) {
        switch (rule.getTransactionalReadQueryStrategy()) {
            case FIXED:
                if (!connectionContext.getTransactionContext().getReadWriteSplitReplicaRoute().isPresent()) {
                    connectionContext.getTransactionContext().setReadWriteSplitReplicaRoute(standardRouter.route(rule));
                }
                return connectionContext.getTransactionContext().getReadWriteSplitReplicaRoute().get();
            case DYNAMIC:
                return standardRouter.route(rule);
            case PRIMARY:
            default:
                return rule.getWriteDataSource();
        }
    }
@Test
    void assertRoute() {
        ReadwriteSplittingDataSourceGroupRuleConfiguration dataSourceGroupConfig = new ReadwriteSplittingDataSourceGroupRuleConfiguration(
                "test_config", "write_ds", Arrays.asList("read_ds_0", "read_ds_1"), null);
        ReadwriteSplittingDataSourceGroupRule rule;
        rule = new ReadwriteSplittingDataSourceGroupRule(dataSourceGroupConfig, TransactionalReadQueryStrategy.PRIMARY, null);
        assertThat(new QualifiedReadwriteSplittingTransactionalDataSourceRouter(new ConnectionContext(Collections::emptySet)).route(rule), is("write_ds"));
        rule = new ReadwriteSplittingDataSourceGroupRule(dataSourceGroupConfig, TransactionalReadQueryStrategy.FIXED, new RoundRobinLoadBalanceAlgorithm());
        assertThat(new QualifiedReadwriteSplittingTransactionalDataSourceRouter(new ConnectionContext(Collections::emptySet)).route(rule), is("read_ds_0"));
        rule = new ReadwriteSplittingDataSourceGroupRule(dataSourceGroupConfig, TransactionalReadQueryStrategy.DYNAMIC, new RoundRobinLoadBalanceAlgorithm());
        assertThat(new QualifiedReadwriteSplittingTransactionalDataSourceRouter(new ConnectionContext(Collections::emptySet)).route(rule), is("read_ds_0"));
    }