@Test
public void shouldOnlyLookupTheDataSourceOnce() throws Exception {

    final String dataSourceName = "java:/DS.framework";
    final DataSource dataSource = mock(DataSource.class);
    when(viewStoreDataSourceNameProvider.getDataSourceName()).thenReturn(dataSourceName);
    when(initialContext.lookup(dataSourceName)).thenReturn(dataSource);
   viewStoreJdbcDataSourceProvider.getDataSource();
   viewStoreJdbcDataSourceProvider.getDataSource();
   viewStoreJdbcDataSourceProvider.getDataSource();
   viewStoreJdbcDataSourceProvider.getDataSource();
   viewStoreJdbcDataSourceProvider.getDataSource();
   viewStoreJdbcDataSourceProvider.getDataSource();
   viewStoreJdbcDataSourceProvider.getDataSource();
   viewStoreJdbcDataSourceProvider.getDataSource();
   viewStoreJdbcDataSourceProvider.getDataSource();
   verify(viewStoreDataSourceNameProvider, times(1)).getDataSourceName();
}