### Question:
KieSQLDataSourceLocator extends SQLDataSourceLocatorCDI { @Override public List< SQLDataSourceDef > list( ) { Collection<DataSourceDefInfo> dataSourceDefInfos = queryService.findGlobalDataSources( true ); List<SQLDataSourceDef> result = new ArrayList<>( ); for ( DataSourceDefInfo dataSourceDefInfo : dataSourceDefInfos ) { result.add( new SQLDataSourceDef( dataSourceDefInfo.getUuid(), dataSourceDefInfo.getName() ) ); } return result; } @Inject  KieSQLDataSourceLocator( DataSourceDefQueryService queryService,
                                    DataSourceRuntimeManager runtimeManager ); @Override DataSource lookup( SQLDataSetDef def ); @Override List< SQLDataSourceDef > list( );  }### Answer:
@Test public void testListDataSources( ) { when( queryService.findGlobalDataSources( true ) ).thenReturn( dataSourceDefInfos ); List< SQLDataSourceDef > result = dataSourceLocator.list( ); verify( queryService, times( 1 ) ).findGlobalDataSources( true ); assertSameElements( dataSourceDefInfos, result ); }