fix(java): exclude tests that use Mockito from native image testing #1753
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Mockito dynamically loads classes at run-time and is currently incompatible with native image testing. Therefore, tests that use Mockito are resulting in the following error when they are executed with native image testing:
DdlClientTest:
SessionClientTest:
Some background on how native image tests are opted in: The logic to opt libraries into native image testing lives in java-shared-config (see https://github.com/googleapis/java-shared-config/blob/1015b908c5aaa6f0b6c77759d86557ca26504868/pom.xml#L811) Currently tests with the IT* and *ClientTest pattern are opted in. The reason for this is to include integration tests in all libraries and unit tests in only generated libraries for native image testing (see this logic for the naming pattern the Gapic generator uses to generate unit tests).
This PR excludes
SessionClientTest
andDdlClientTest
from native image testing by renaming them toSessionClientTests
andDdlClientTests
.cc @ansh0l @meltsufin