### Question:
KieSQLDataSourceLocator extends SQLDataSourceLocatorCDI { @Override public DataSource lookup( SQLDataSetDef def ) throws Exception { return ((AbstractDataSource) runtimeManager.lookupDataSource( def.getDataSource() ) ).getInternalDataSource(); } @Inject  KieSQLDataSourceLocator( DataSourceDefQueryService queryService,
                                    DataSourceRuntimeManager runtimeManager ); @Override DataSource lookup( SQLDataSetDef def ); @Override List< SQLDataSourceDef > list( );  }### Answer:
@Test public void testLookup( ) throws Exception { when( dataSetDef.getDataSource( ) ).thenReturn( "uuid" ); when( runtimeManager.lookupDataSource( "uuid" ) ).thenReturn( abstractDataSource ); when( abstractDataSource.getInternalDataSource( ) ).thenReturn( dataSource ); DataSource result = dataSourceLocator.lookup( dataSetDef ); verify( runtimeManager, times( 1 ) ).lookupDataSource( "uuid" ); assertEquals( dataSource, result ); }