diff --git a/spring-cloud-aws-autoconfigure/src/test/java/io/awspring/cloud/autoconfigure/config/parameterstore/ParameterStoreAutoConfigurationTest.java b/spring-cloud-aws-autoconfigure/src/test/java/io/awspring/cloud/autoconfigure/config/parameterstore/ParameterStoreAutoConfigurationTest.java index d15df319c..36e6d5694 100644 --- a/spring-cloud-aws-autoconfigure/src/test/java/io/awspring/cloud/autoconfigure/config/parameterstore/ParameterStoreAutoConfigurationTest.java +++ b/spring-cloud-aws-autoconfigure/src/test/java/io/awspring/cloud/autoconfigure/config/parameterstore/ParameterStoreAutoConfigurationTest.java @@ -1,5 +1,23 @@ +/* + * Copyright 2013-2024 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package io.awspring.cloud.autoconfigure.config.parameterstore; +import static org.assertj.core.api.Assertions.assertThat; +import static org.mockito.Mockito.mock; + import io.awspring.cloud.autoconfigure.core.AwsAutoConfiguration; import io.awspring.cloud.autoconfigure.core.CredentialsProviderAutoConfiguration; import io.awspring.cloud.autoconfigure.core.RegionProviderAutoConfiguration; @@ -11,30 +29,27 @@ import org.springframework.context.annotation.Bean; import software.amazon.awssdk.services.ssm.SsmClient; -import static org.assertj.core.api.Assertions.assertThat; -import static org.mockito.Mockito.mock; - /** * Tests for {@link ParameterStoreAutoConfiguration} */ class ParameterStoreAutoConfigurationTest { private final ApplicationContextRunner contextRunner = new ApplicationContextRunner() - .withPropertyValues("spring.cloud.aws.region.static:eu-west-1") - .withConfiguration(AutoConfigurations.of(RegionProviderAutoConfiguration.class, - CredentialsProviderAutoConfiguration.class, ParameterStoreAutoConfiguration.class, - AwsAutoConfiguration.class)); + .withPropertyValues("spring.cloud.aws.region.static:eu-west-1") + .withConfiguration(AutoConfigurations.of(RegionProviderAutoConfiguration.class, + CredentialsProviderAutoConfiguration.class, ParameterStoreAutoConfiguration.class, + AwsAutoConfiguration.class)); @Test void parameterStoreAutoConfigurationIsDisabled() { this.contextRunner.withPropertyValues("spring.cloud.aws.parameterstore.enabled:false") - .run(context -> assertThat(context).doesNotHaveBean(SsmClient.class)); + .run(context -> assertThat(context).doesNotHaveBean(SsmClient.class)); } @Test void parameterStoreAutoConfigurationIsEnabled() { this.contextRunner.withPropertyValues("spring.cloud.aws.parameterstore.enabled:true") - .run(context -> assertThat(context).hasSingleBean(SsmClient.class)); + .run(context -> assertThat(context).hasSingleBean(SsmClient.class)); } @Test