-
Notifications
You must be signed in to change notification settings - Fork 80
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
Load real driver class before use #31
Conversation
Add loadRealDriver method to load the class indicated by realDriverClass. Throw IllegalStateException if the class does not exist.
I am using this change on a project which uses Note that I have not tested it with any other drivers. However, the tests run as part of the install script all passed. |
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.
main branch already has called getDefaultDriverClass(); in Line 195 of AWSSecretsManagerDriver.java
Yep! And the addition in this pull request makes use of this knowledge, and that the result of that call is put into
It's been a while since I created this pull request, and my mind has been elsewhere since. If I miss something simple, let me know! Also, I am no longer working on the project in which I came across this issue, so I will be unable to test any changes within that context. |
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.
One year later... confirm this commit resolve my same issue today.
Issue #, if available: #26
Description of changes:
Load the real driver before it is used by calling
Class.forName(this.realDriverClass)
. This ensures that the real driver has an opportunity to be registered.If the real driver class does not exist, an
IllegalStateException
is thrown. This exception matches theassertThrows
tested byAWSSecretsManagerDriverTest.test_getWrappedDriver_throws_badDriver
.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.