@Test
public void testCreateDataSource() throws Throwable {

    // GIVEN
    final DataSourceDecorator decorator = new DataSourceDecorator();
    // WHEN
    decorator.beforeAll(invocation);
    // THEN
    final ArgumentCaptor<BasicDataSource> dsCaptor = ArgumentCaptor.forClass(BasicDataSource.class);
    verify(ctx).storeData(eq(Constants.KEY_DATA_SOURCE), dsCaptor.capture());
    final BasicDataSource dataSource = dsCaptor.getValue();
    assertThat(dataSource.getUsername(), equalTo("user"));
    assertThat(dataSource.getPassword(), equalTo("password"));
    assertThat(dataSource.getDriverClassName(), equalTo("driver"));
    assertThat(dataSource.getUrl(), equalTo("url"));
}