Closed fredex42 closed 4 months ago
0 tests ±0 0 :white_check_mark: ±0 0s :stopwatch: ±0s 0 suites ±0 0 :zzz: ±0 0 files ±0 0 :x: ±0
Results for commit 4f294296. ± Comparison against base commit c406c9e1.
@fredex42 has published a preview version of this PR with release workflow run #64, based on commit 4f294296ce3f0ee50193d93697353812f3326602:
31.0.3-PREVIEW.agcovariant-query-response.2024-06-28T1631.4f294296
What does this change?
Changes the
Response
type parameter from invarant to covariant.This is to make pattern-matching in tests to work better - used in integration tests introduced with https://github.com/guardian/crier/pull/169.
In a nutshell, we needed to be able to use Mockito to verify two different calls to the library. If the calls changed order, the behaviour would still be correct (ordering cannot be guaranteed in this case) but the test would then fail if it tried to cast the
SearchQuery
to theItemQuery
or vice-versa.With this update in place, we can make a correctly scoped
match
statement to handle both of these cases gracefully:Without this update, the compiler objects since the type signature of
ContentApiQuery[Response]
requires specific response type and not an ancestor of this type. When changed toContentApiQuery[+Response]
we are able to successfully match against any possible value.How to test
Integration tests linked above work.
Tested locally.
How can we measure success?
Able to continue on Crier
Have we considered potential risks?
n/a