Mockito.when( mockDriver.connect( url, new Properties() ) ).thenReturn( mockConn );
Mockito.when( mockDriver.acceptsURL( url ) ).thenReturn( true );
Mockito.when( mockDriver.connect( url2, new Properties() ) ).thenReturn( null );
Mockito.when( mockDriver.acceptsURL( url2 ) ).thenReturn( false );
Mockito.when( mockDriver2.connect( url, new Properties() ) ).thenReturn( null );
Mockito.when( mockDriver2.acceptsURL( url ) ).thenReturn( false );
Mockito.when( mockDriver2.connect( url2, new Properties() ) ).thenReturn( mockConn2 );
Mockito.when( mockDriver2.acceptsURL( url2 ) ).thenReturn( true );
Connection conn = DriverManager.getConnection( url );
Assert.assertSame( mockConn, conn );
Connection conn2 = DriverManager.getConnection( url2 );