Skip to content
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

Implement schema methods in the HttpManagementProxy (fixes #1344) #1366

Conversation

olim7t
Copy link
Collaborator

@olim7t olim7t commented Aug 23, 2023

Fixes #1344

Prerequisites:

@github-actions
Copy link

No linked issues found. Please add the corresponding issues in the pull request description.
Use GitHub automation to close the issue when a PR is merged

@olim7t olim7t marked this pull request as ready for review August 24, 2023 01:25
Copy link
Contributor

@Miles-Garnsey Miles-Garnsey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry this has taken me a little while to get to, I thought someone else was reviewing it!

Just requesting changes to add unit tests, let me know if you have any concerns.

@@ -159,12 +161,27 @@ public String getClusterName() {

@Override
public List<String> getKeyspaces() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Issue: Can we please have a unit test for this method? Maybe something that mocks apiClient.listKeyspaces() and then just confirms that it was called?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Miles-Garnsey , is this a todo: or a suggestion: ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, an issue I think.

} catch (ApiException ae) {
LOG.error("Failed to list keyspaces", ae);
return Collections.emptyList();
}
}

@Override
public Set<Table> getTablesForKeyspace(String keyspace) throws ReaperException {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Issue: Would be good to see a unit test for this too please :) Similar procedure to the other one, mock the call to the apiClient method and confirm that the processing in the rest of the method does what it should.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added both unit tests as requested.

Copy link
Contributor

@Miles-Garnsey Miles-Garnsey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like it is all passing (there is one still running but I'm confident), those tests look great too. Thanks for adding a generic method to create the mocked proxy.

@Miles-Garnsey
Copy link
Contributor

I am merging this because all tests are green, it is approved, and I want the mockProxy() method for my own tests.

@Miles-Garnsey Miles-Garnsey merged commit cd9898a into thelastpickle:integration/http-managementproxy Aug 31, 2023
22 of 24 checks passed
@olim7t olim7t deleted the feature/schema-methods branch August 31, 2023 14:11
@adejanovski adejanovski linked an issue Sep 1, 2023 that may be closed by this pull request
2 tasks
adejanovski pushed a commit that referenced this pull request Sep 6, 2023
)

* Implement schema methods in the HttpManagementProxy (fixes #1344)
Miles-Garnsey pushed a commit that referenced this pull request Oct 3, 2023
)

* Implement schema methods in the HttpManagementProxy (fixes #1344)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement schema methods in the HttpManagementProxy
3 participants