@Test
public void testPrepare() throws Exception {

    // Create the object under test
    ProductionLiquibaseRunner runner = new ProductionLiquibaseRunner();
    // Mock the UkelonnLiquibase and the Liquibase (to avoid having to mock a lot of JDBC)
    UkelonnLiquibase ukelonnLiquibase = mock(UkelonnLiquibase.class);
    UkelonnLiquibaseFactory ukelonnLiquibaseFactory = mock(UkelonnLiquibaseFactory.class);
    when(ukelonnLiquibaseFactory.create()).thenReturn(ukelonnLiquibase);
    runner.setUkelonnLiquibaseFactory(ukelonnLiquibaseFactory);
    Liquibase liquibase = mock(Liquibase.class);
    LiquibaseFactory liquibaseFactory = mock(LiquibaseFactory.class);
    when(liquibaseFactory.create(anyString(), any(), any())).thenReturn(liquibase);
    runner.setLiquibaseFactory(liquibaseFactory);
    // Mock injected OSGi services
    MockLogService logservice = new MockLogService();
    DataSource datasource = mock(DataSource.class);
    Connection connection = mock(Connection.class);
    when(datasource.getConnection()).thenReturn(connection);
    runner.setLogService(logservice);
    runner.activate();
    // Execute the method under test
    runner.prepare(datasource);
    // Verify that no errors have been logged
    assertEquals(0, logservice.getLogmessagecount());
}