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.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SOLR-15749: Create v2 equivalent for 'rename' collection API #1080
SOLR-15749: Create v2 equivalent for 'rename' collection API #1080
Changes from 6 commits
fb50537
9273f9f
edd217a
ec887df
468f811
9109a59
6f7c37b
f497b74
5c86d51
975d1e6
50e3ac9
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test result returns java.lang.AssertionError: expected:<rename> but was:<null>
What if we mock
SolrQueryRequest
andSolrQueryResponse
, pass them to thepublic void renameCollection(SolrQueryRequest req, SolrQueryResponse rsp)
method of the API then perform the assertionsThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will try to implement that, thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please I need more clarification on this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what exactly you would like to be clarified. If its about mocks checkout
AddReplicaPropertyAPITest
which uses mockedSolrQueryRequest
andSolrQueryResponse
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 to what Josh said. AddReplicaPropertyAPITest is a good example on how to use mocks, but it's setup for APIs that use the JAX-RS framework, so you wouldn't want to follow it too closely. But it's good if you're just looking for an example on the mock stuff.
And I'm sure we'd both be happy to clarify if you can elaborate a bit on what you need clarified.
[Q] One thing that jumps out at me on this line is the
runRenameCollectionsAPI
: is there a reason you've created a separate method for this instead of reusing one of thecaptureConvertedV1Params
methods that's already out there. If there's not some reason forrunRenameCollectionsAPI
that I'm missing, you could presumably just replace its usage here with a snippet like:The second thing that jumps out at me here is the path being sent as an argument to this method - it doesn't match the path of the API you created in this PR (see here).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought you said we were moving away from the old captureConvertedV1Params syntax, I wasn't aware there are different method implementations
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, not quite. Or at least, I didn't mean to suggest that?
What I probably meant to say is that Solr is moving away from its traditional v2 API framework to a framework based on JAX-RS.
captureConvertedV1Params
is a nice utility for testing APIs implemented using the "traditional" (i.e. non JAX-RS) framework.In the long run I'd expect to see usage of
captureConvertedV1Params
decline, but not because it's deprecated or shouldn't be used - just because things will switch over to JAX-RS as time goes by. This PR uses the traditional framework (which is absolutely still valid), so it's fine/normal to usecaptureConvertedV1Params
in your tests.I'll push up a commit here to help get the unit test over the line and then hopefully we can get this merged 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's clearer now, and I'm so glad to hear that this will be merged thank you.