Align AWS Parameter Store Factory bean name with profile name (#2336)

Co-authored-by: Ryan Baxter <524254+ryanjbaxter@users.noreply.github.com>
This commit is contained in:
Ryan Baxter
2023-10-13 11:29:22 -04:00
committed by GitHub
parent 26cb8184b7
commit ccfec57777
3 changed files with 22 additions and 2 deletions

View File

@@ -23,6 +23,7 @@ import org.springframework.boot.autoconfigure.AutoConfigureBefore;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.test.context.TestConfiguration;
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
import org.springframework.cloud.config.server.environment.AwsParameterStoreEnvironmentRepositoryFactory;
import org.springframework.cloud.config.server.environment.ConfigTokenProvider;
import org.springframework.cloud.config.server.environment.EnvironmentConfigTokenProvider;
import org.springframework.cloud.config.server.environment.EnvironmentRepository;
@@ -55,6 +56,19 @@ public class EnvironmentRepositoryConfigurationTests {
});
}
@Test
public void awsParamStoreFactoryBeanExistsWithComposite() {
new ApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(EnvironmentRepositoryConfiguration.class, TestBeans.class))
.withPropertyValues("spring.profiles.active=composite",
"spring.cloud.config.server.composite[0].type=awsparamstore",
"spring.cloud.config.server.composite[1].type=git",
"spring.cloud.config.server.composite[1].uri=https://test.com/Some-Test-Repo.git")
.run((context) -> {
assertThat(context.getBean(AwsParameterStoreEnvironmentRepositoryFactory.class)).isNotNull();
});
}
@Test
public void customGitCredentialsProvider() {
new ApplicationContextRunner()