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

Add JDBC custom credential support for postgres #1293

Merged
merged 4 commits into from
Mar 17, 2019

Conversation

manikmagar
Copy link
Contributor

This PR adds custom username and password support for Postgres. It refactors the function in MySQL and MariaDB drivers to reuse. This is based on #617 .

Copy link
Member

@rnorth rnorth left a comment

Choose a reason for hiding this comment

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

I only have some trivial style suggestions, but otherwise this is great. Thank you very much!

rs.next();
String resultUser = rs.getString(1);
assertEquals("User from query param is created.", "someuser@%", resultUser);
// Not all databases (eg. Postgres) return @% at the end of user name. We just need to make sure the user name matches.
if(resultUser.endsWith("@%")) resultUser = resultUser.substring(0, resultUser.length() - 2);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if(resultUser.endsWith("@%")) resultUser = resultUser.substring(0, resultUser.length() - 2);
if (resultUser.endsWith("@%")) {
resultUser = resultUser.substring(0, resultUser.length() - 2);
}

Just a small style change.

Copy link
Member

@rnorth rnorth left a comment

Choose a reason for hiding this comment

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

I only have some trivial style suggestions, but otherwise this is great. Thank you very much!

@manikmagar
Copy link
Contributor Author

Thanks for the review @rnorth . I have formatted the code in the latest commit. Please check when you get a chance.

Copy link
Member

@kiview kiview left a comment

Choose a reason for hiding this comment

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

Looks great for me, thanks!

@rnorth
Copy link
Member

rnorth commented Mar 17, 2019

Thanks @manikmagar!

@rnorth rnorth merged commit 1fe2804 into testcontainers:master Mar 17, 2019
@rnorth rnorth added this to the 1.11.0 milestone Mar 22, 2019
@rnorth
Copy link
Member

rnorth commented Mar 22, 2019

Releasing this in 1.11.0 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants