mirror of https://github.com/apache/lucene.git
SOLR-9966: Fix previous commit bug
This commit is contained in:
parent
6358afbea6
commit
54303260aa
|
@ -35,6 +35,7 @@ import java.util.Properties;
|
|||
|
||||
import javax.sql.DataSource;
|
||||
|
||||
import org.apache.lucene.util.Constants;
|
||||
import org.apache.solr.handler.dataimport.JdbcDataSource.ResultSetIterator;
|
||||
import static org.mockito.Mockito.*;
|
||||
import org.junit.After;
|
||||
|
@ -484,6 +485,8 @@ public class TestJdbcDataSource extends AbstractDataImportHandlerTestCase {
|
|||
|
||||
@Test
|
||||
public void testRetrieveFromDriverManager() throws Exception {
|
||||
// in JDK9, Class.forName will throw exception for mock classes
|
||||
if (Constants.JRE_IS_MINIMUM_JAVA9) return;
|
||||
DriverManager.registerDriver(driver);
|
||||
try {
|
||||
when(driver.connect(notNull(),notNull())).thenReturn(connection);
|
||||
|
|
|
@ -98,7 +98,7 @@ public class TestCoreAdminApis extends SolrTestCaseJ4 {
|
|||
when(mockCC.getCoreRootDirectory()).thenReturn(Paths.get("coreroot"));
|
||||
when(mockCC.getContainerProperties()).thenReturn(new Properties());
|
||||
|
||||
when(mockCC.getRequestHandlers()).thenReturn((PluginBag<SolrRequestHandler>) out.get("getRequestHandlers"));
|
||||
when(mockCC.getRequestHandlers()).thenAnswer(invocationOnMock -> out.get("getRequestHandlers"));
|
||||
return mockCC;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue