blob: 16edace9b85976cd432c8ccce4618a2105e488f4 [file] [log] [blame]
package org.apache.shardingsphere.example;
import org.apache.shardingsphere.example.core.api.ExampleExecuteTemplate;
import org.apache.shardingsphere.example.core.api.service.ExampleService;
import org.apache.shardingsphere.example.core.mybatis.common.SpringResultAssertUtils;
import org.apache.shardingsphere.example.core.mybatis.service.UserServiceImpl;
import org.junit.Test;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import java.sql.SQLException;
public class SpringNamespaceShardingMasterSlaveEncryptTest {
private static final String CONFIG_FILE = "META-INF/application-sharding-master-slave-encrypt.xml";
@Test
public void assertCommonService() throws SQLException {
try (ConfigurableApplicationContext applicationContext = new ClassPathXmlApplicationContext(CONFIG_FILE)) {
ExampleService exampleService = applicationContext.getBean(UserServiceImpl.class);
ExampleExecuteTemplate.run(exampleService);
SpringResultAssertUtils.assertExampleServiceMasterSlaveEncryptResult(exampleService);
}
}
}