Uwe Schindler created SOLR-11606:
------------------------------------
Summary: Mockito does not work with newer Java versions -> disable
tests automatically when no working Mockito
Key: SOLR-11606
URL: https://issues.apache.org/jira/browse/SOLR-11606
Project: Solr
Issue Type: Bug
Security Level: Public (Default Security Level. Issues are Public)
Components: Tests
Reporter: Uwe Schindler
Assignee: Uwe Schindler
Priority: Normal
Fix For: 7.2, master (8.0)
When running Solr's tests with Java versions that are not supported by the
Mockito mocking library, it fails with an error message.
We should disable the tests, if the underlying Mockito version does not allow
to mock classes, because the Java version is too new. There is already and
issue open at ByteBuddy that is the root cause.
The idea here is to use ByteBuddy's ClassFileVersion class to check if mocking
is supported. This adds a new method to SolrTestCaseJ4:
{{assumeWorkingMockito()}}
Tests that use the Mockito library should add this assume to their tests, to
disable them if the mocking is not supported. Instead of using a Java version
test, we do this with ByteBuddy, because this is more dynamic (if we update
Mockito so it works with newer Java versions, it is automatically working).
At the same time, we should update Mockito/ByteBuddy ASAP when a new version is
available.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]