chore: fix tests for updated Schema Registry client internals #9982
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.
Description
Some unit tests are failing in the build after confluentinc/schema-registry#2674 was merged, due to improper usage of mock SR clients on the ksql side. We should be using the provided
MockSchemaRegistryClient
implementation rather thanMockito.mock(SchemaRegistryClient.class)
since the methods which need to be mocked when using the latter are implementation details of SR which are subject to change.The specific failure in this case is that a new internal method added to the
SchemaRegistryClient
usage is resulting in an NPE in our unit tests because the unit tests do not provide mocked implementations for this new method. Here's an example failure fromKsqlJsonSchemaDeserializerTest.shouldDeserializeJsonObjectCorrectly
:This PR fixes the failing tests by updating our mock SR client usage to
MockSchemaRegistryClient
.This PR also contains an additional fix for the SR dependency version: it was set to
7.6.0-0
in this PR which is a mistake -- setting the version to a-0
nanoversion means that Jenkins no longer automatically bumps the version as new nanoversions are released (here's an example of where this previously happened), which means ksql development locally will not match what's seen in Jenkins, since Jenkins continually recompiles the latest schema-registry whereas ksql developers typically do not.Testing done
Describe the testing strategy. Unit and integration tests are expected for any behavior changes.
Reviewer checklist