-
Notifications
You must be signed in to change notification settings - Fork 18
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
feat: allow endpoint overrides in AwsSecretsManagerVault #485
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,4 +47,15 @@ void configOptionRegionProvided_shouldNotThrowException() { | |
extension.createVault(validContext); | ||
} | ||
|
||
@Test | ||
void configOptionEndpointOverrideProvided_shouldNotThrowException() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this test is asserting nothing. I know that you inherited from the already existing tests, but tests without assertions should be avoided. var vault = extension.createVault(validContext);
assertThat(vault).extracting("smClient", type(SecretsManagerClient.class)).satisfies(client -> {
assertThat(client.serviceClientConfiguration().endpointOverride()).contains(URI.create("http://localhost:4566"));
}); it won't pass, that's because you set the mock to respond a call where only the setting key is passed, but not the default value. |
||
ServiceExtensionContext validContext = mock(ServiceExtensionContext.class); | ||
Config cfg = mock(); | ||
when(cfg.getString("edc.vault.aws.region")).thenReturn("eu-west-1"); | ||
when(cfg.getString("edc.aws.endpoint.override")).thenReturn("http://localhost:4566"); | ||
when(validContext.getConfig()).thenReturn(cfg); | ||
when(validContext.getMonitor()).thenReturn(monitor); | ||
|
||
extension.createVault(validContext); | ||
} | ||
} |
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 think this setting should be different than the one used to create the S3 client, and be called
edc.vault.aws.endpoint.override
, to align with the region setting.plus, settings can be injected in a different way, as described in this DR
Please adapt and add some
description
to the annotation