-
Notifications
You must be signed in to change notification settings - Fork 0
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
DR2-1982 Remove mockito from rotate password #341
base: main
Are you sure you want to change the base?
Conversation
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.
Looks good! Just some minor comments.
new Lambda().handler(rotationEvent, config, dependencies).unsafeRunSync() | ||
|
||
verify(userClient, times(1)).testNewPassword() | ||
res.left.value.getMessage should equal("Password test failed") | ||
} | ||
|
||
"handler finishSecret" should "return an error if the pending secret has no version" in { |
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 test doesn't return an error
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.
Oh yeah, copy and paste error I think. I've changed it.
new Lambda().handler(rotationEvent, config, dependencies).unsafeRunSync() | ||
|
||
verify(secretsManagerClient, times(0)).putSecretValue(any[String], any[Stage], any[Option[String]])(using any[Encoder[String]]) | ||
secretResult.versionToStage.size should equal(1) | ||
} | ||
|
||
"handler createSecret" should "putSecretValue if a Pending value does not already exist" in { |
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 know you didn't do this in this PR, but should this be "calls putSecretValue"?
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 don't think so because we're not checking the method is called. It is a bit odd the way it is though so I've gone with "create the secret value if a Pending value does not already exist"
new Lambda().handler(rotationEvent, config, dependencies).unsafeRunSync() | ||
|
||
verify(secretsManagerClient, times(0)).putSecretValue(any[String], any[Stage], any[Option[String]])(using any[Encoder[String]]) | ||
secretResult.versionToStage.size should equal(1) |
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 it worth checking the password is still the same/the expected one?
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 slightly superfluous but one extra line doesn't hurt. I've added it in.
This needs nationalarchives/da-aws-clients#330 before the tests will pass