private ConnectionRepository connectionRepository;
@Before
public void setUp() {
EmbeddedDatabaseFactory factory = new EmbeddedDatabaseFactory();
if (testMySqlCompatiblity) {
factory.setDatabaseConfigurer(new MySqlCompatibleH2DatabaseConfigurer());
} else {
factory.setDatabaseType(EmbeddedDatabaseType.H2);
}
ResourceDatabasePopulator populator = new ResourceDatabasePopulator();
populator.addScript(new ClassPathResource(getSchemaSql(), getClass()));
factory.setDatabasePopulator(populator);
database = factory.getDatabase();
dataAccessor = new JdbcTemplate(database);
connectionFactoryRegistry = new ConnectionFactoryRegistry();
connectionFactory = new TestFacebookConnectionFactory();
connectionFactoryRegistry.addConnectionFactory(connectionFactory);
usersConnectionRepository = new JdbcUsersConnectionRepository(database, connectionFactoryRegistry, Encryptors.noOpText());