@Test
public void shouldLookUpTheDataSourceUsingTheCorrectJndiName() throws Exception {

    final String dataSourceName = "java:/app/framework/DS.system";
    final DataSource dataSource = mock(DataSource.class);
    when(systemDataSourceNameProvider.getDataSourceName()).thenReturn(dataSourceName);
    when(initialContext.lookup(dataSourceName)).thenReturn(dataSource);
    assertThat(systemJdbcDataSourceProvider.getDataSource(), is(dataSource));
}