docs(samples): added samples and test for recaptcha key operations #643
Conversation
Here is the summary of changes. You are about to add 2 region tags.
This comment is generated by snippet-bot.
|
@eaball35 PTAL |
System.out.println(key.getName()); | ||
} | ||
return response; |
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.
No need to return the response, keep void. https://github.com/GoogleCloudPlatform/java-docs-samples/blob/main/SAMPLE_FORMAT.md#method-structure
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.
This response is being used in the MigrateKey file. Returning void would mean adding this piece of code to the MigrateKey file (which would be redundant).
Is it okay to treat cases like this as an exception?
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.
Should avoid returning any value wherever possible, but otherwise fine
* @param projectId: Google Cloud Project Id. | ||
* @param recaptchaSiteKey: Specify the site key to migrate. | ||
*/ | ||
public static void migrateKey(String projectId, String recaptchaSiteKey) throws IOException { |
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.
Is this one tested?
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.
Migrate key can't be tested through client libraries as the non-enterprise version of the key needs to be created only through the Admin Console.
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.
Left a few comments
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
Fixes #642 ☕️