String[] driverIds = new String[]
{ "org.apache.felix.driver-1.0", "org.apache.felix.driver-1.1" };
int[] driverMatches = new int[]{ 1, Device.MATCH_NONE };
DriverLocator locator = Mockito.mock( DriverLocator.class, "locator for v1.x" );
Map<String, Driver> drivers = tstExpectDriverLocatorFor( locator, driverIds, driverMatches );
DriverLocator locatorv2 = Mockito.mock( DriverLocator.class, "locator for v2.x (fails always)" );
Mockito.when( locatorv2.findDrivers( Mockito.isA( Dictionary.class ) ) )
.thenReturn( null );
Mockito.when( locatorv2.loadDriver( Mockito.startsWith( "org.apache.felix.driver-1" ) ) )
.thenReturn( null );
InputStream referredInputStream = Mockito.mock(InputStream.class);
Mockito.when( locatorv2.loadDriver( referredDriver ) ).thenReturn( referredInputStream );
//this is what initial driver referral eventually leads
//to: the loading of a driver bundle
//we fake it, so that it fails