PP-6085 Add accept header to test #581
Merged
+6
−1
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.
There are two methods within
TransactionResource
namedsearch
andstreamCsv
. Both use the path/
and http methodGET
but provideeither "application/json" or "text/csv" respectively.
According to the jax-rs specification when the client does not specify
the "accept" header then it is not garanteed as to which method will be
invoked, since both methods have the same level of specificity in what
they provide.
When
shouldReturn400IfTransactionGatewayAccountIdIsNotProvidedForSearch
runs locally and on Jenkins the
search
method is invoked as expected,however on Travis
streamCsv
is called and an NPE is thrown as the testprovides a mock config with null parameters.
This shouldn't be a concern in production since the client of this
service is publicApi which provides an accept header. Therefore we feel it is
exceptable to add the header to the test and not disambiguate the
two methods any further.