Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-build</artifactId>
<version>5.0.0-M1</version>
<version>5.0.0-RC1</version>
<relativePath/><!-- lookup parent from repository -->
</parent>

Expand Down
22 changes: 16 additions & 6 deletions spring-cloud-aws-autoconfigure/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-metrics</artifactId>
<artifactId>spring-boot-micrometer-metrics</artifactId>
<optional>true</optional>
</dependency>
<dependency>
Expand Down Expand Up @@ -137,13 +137,13 @@
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>localstack</artifactId>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers-localstack</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>junit-jupiter</artifactId>
<groupId>org.testcontainers</groupId>
Comment thread
MatejNedic marked this conversation as resolved.
Outdated
<artifactId>testcontainers-junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -161,14 +161,24 @@
<artifactId>spring-cloud-commons</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-micrometer-metrics-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-context</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
<artifactId>spring-boot-starter-aspectj</artifactId>
<optional>true</optional>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import org.springframework.boot.BootstrapContext;
import org.springframework.boot.BootstrapRegistry;
import org.springframework.boot.ConfigurableBootstrapContext;
import org.springframework.boot.bootstrap.BootstrapContext;
import org.springframework.boot.bootstrap.BootstrapRegistry;
import org.springframework.boot.bootstrap.ConfigurableBootstrapContext;
import org.springframework.boot.context.config.ConfigDataLocation;
import org.springframework.boot.context.config.ConfigDataLocationNotFoundException;
import org.springframework.boot.context.config.ConfigDataLocationResolver;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.logging.Log;
import org.springframework.boot.BootstrapRegistry;
import org.springframework.boot.bootstrap.BootstrapRegistry;
import org.springframework.boot.logging.DeferredLogFactory;
import org.springframework.util.ClassUtils;
import org.springframework.util.ReflectionUtils;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.logging.Log;
import org.springframework.boot.BootstrapContext;
import org.springframework.boot.bootstrap.BootstrapContext;
import org.springframework.boot.context.config.ConfigDataLocation;
import org.springframework.boot.context.config.ConfigDataLocationNotFoundException;
import org.springframework.boot.context.config.ConfigDataLocationResolverContext;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.logging.Log;
import org.springframework.boot.BootstrapContext;
import org.springframework.boot.bootstrap.BootstrapContext;
import org.springframework.boot.context.config.ConfigDataLocation;
import org.springframework.boot.context.config.ConfigDataLocationNotFoundException;
import org.springframework.boot.context.config.ConfigDataLocationResolverContext;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.logging.Log;
import org.springframework.boot.BootstrapContext;
import org.springframework.boot.bootstrap.BootstrapContext;
import org.springframework.boot.context.config.*;
import org.springframework.boot.context.properties.bind.Bindable;
import org.springframework.boot.context.properties.bind.Binder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,10 @@ private static AwsCredentialsProvider create(@Nullable StsProperties stsProperti

if (stsProperties != null) {
builder.asyncCredentialUpdateEnabled(stsProperties.isAsyncCredentialsUpdate());
propertyMapper.from(stsProperties::getRoleArn).whenNonNull().to(builder::roleArn);
propertyMapper.from(stsProperties::getWebIdentityTokenFile).whenNonNull()
propertyMapper.from(stsProperties::getRoleArn).to(builder::roleArn);
propertyMapper.from(stsProperties::getWebIdentityTokenFile)
.to(b -> builder.webIdentityTokenFile(Paths.get(b)));
propertyMapper.from(stsProperties::getRoleSessionName).whenNonNull().to(builder::roleSessionName);
propertyMapper.from(stsProperties::getRoleSessionName).to(builder::roleSessionName);
}
return builder.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,24 +77,20 @@ public DynamoDbClient dynamoDbClient(DynamoDbProperties properties, AwsCredentia

PropertyMapper propertyMapper = PropertyMapper.get();
software.amazon.dax.Configuration.Builder configuration = software.amazon.dax.Configuration.builder();
propertyMapper.from(daxProperties.getIdleTimeoutMillis()).whenNonNull()
.to(configuration::idleTimeoutMillis);
propertyMapper.from(daxProperties.getConnectionTtlMillis()).whenNonNull()
.to(configuration::connectionTtlMillis);
propertyMapper.from(daxProperties.getConnectTimeoutMillis()).whenNonNull()
.to(configuration::connectTimeoutMillis);
propertyMapper.from(daxProperties.getRequestTimeoutMillis()).whenNonNull()
.to(configuration::requestTimeoutMillis);
propertyMapper.from(daxProperties.getWriteRetries()).whenNonNull().to(configuration::writeRetries);
propertyMapper.from(daxProperties.getReadRetries()).whenNonNull().to(configuration::readRetries);
propertyMapper.from(daxProperties.getClusterUpdateIntervalMillis()).whenNonNull()
propertyMapper.from(daxProperties.getIdleTimeoutMillis()).to(configuration::idleTimeoutMillis);
propertyMapper.from(daxProperties.getConnectionTtlMillis()).to(configuration::connectionTtlMillis);
propertyMapper.from(daxProperties.getConnectTimeoutMillis()).to(configuration::connectTimeoutMillis);
propertyMapper.from(daxProperties.getRequestTimeoutMillis()).to(configuration::requestTimeoutMillis);
propertyMapper.from(daxProperties.getWriteRetries()).to(configuration::writeRetries);
propertyMapper.from(daxProperties.getReadRetries()).to(configuration::readRetries);
propertyMapper.from(daxProperties.getClusterUpdateIntervalMillis())
.to(configuration::clusterUpdateIntervalMillis);
propertyMapper.from(daxProperties.getEndpointRefreshTimeoutMillis()).whenNonNull()
propertyMapper.from(daxProperties.getEndpointRefreshTimeoutMillis())
.to(configuration::endpointRefreshTimeoutMillis);
propertyMapper.from(daxProperties.getMaxConcurrency()).whenNonNull().to(configuration::maxConcurrency);
propertyMapper.from(daxProperties.getMaxPendingConnectionAcquires()).whenNonNull()
propertyMapper.from(daxProperties.getMaxConcurrency()).to(configuration::maxConcurrency);
propertyMapper.from(daxProperties.getMaxPendingConnectionAcquires())
.to(configuration::maxPendingConnectionAcquires);
propertyMapper.from(daxProperties.getSkipHostNameVerification()).whenNonNull()
propertyMapper.from(daxProperties.getSkipHostNameVerification())
.to(configuration::skipHostNameVerification);

configuration.region(AwsClientBuilderConfigurer.resolveRegion(properties,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.metrics.autoconfigure.CompositeMeterRegistryAutoConfiguration;
import org.springframework.boot.metrics.autoconfigure.MetricsAutoConfiguration;
import org.springframework.boot.metrics.autoconfigure.export.simple.SimpleMetricsExportAutoConfiguration;
import org.springframework.boot.micrometer.metrics.autoconfigure.CompositeMeterRegistryAutoConfiguration;
import org.springframework.boot.micrometer.metrics.autoconfigure.MetricsAutoConfiguration;
import org.springframework.boot.micrometer.metrics.autoconfigure.export.simple.SimpleMetricsExportAutoConfiguration;
import org.springframework.context.annotation.Bean;
import software.amazon.awssdk.regions.providers.AwsRegionProvider;
import software.amazon.awssdk.services.cloudwatch.CloudWatchAsyncClient;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
package io.awspring.cloud.autoconfigure.metrics;

import io.micrometer.cloudwatch2.CloudWatchConfig;
import org.springframework.boot.metrics.autoconfigure.export.properties.StepRegistryPropertiesConfigAdapter;
import org.springframework.boot.micrometer.metrics.autoconfigure.export.properties.StepRegistryPropertiesConfigAdapter;

/**
* Adapter to convert {@link CloudWatchRegistryProperties} to a {@link CloudWatchConfig}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
package io.awspring.cloud.autoconfigure.metrics;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.metrics.autoconfigure.export.properties.StepRegistryProperties;
import org.springframework.boot.micrometer.metrics.autoconfigure.export.properties.StepRegistryProperties;

/**
* {@link ConfigurationProperties} for configuring CloudWatch metrics export.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,10 @@ S3AsyncClient s3AsyncClient(AwsCredentialsProvider credentialsProvider,
if (this.properties.getCrt() != null) {
S3CrtClientProperties crt = this.properties.getCrt();
PropertyMapper propertyMapper = PropertyMapper.get();
propertyMapper.from(crt::getMaxConcurrency).whenNonNull().to(builder::maxConcurrency);
propertyMapper.from(crt::getTargetThroughputInGbps).whenNonNull().to(builder::targetThroughputInGbps);
propertyMapper.from(crt::getMinimumPartSizeInBytes).whenNonNull().to(builder::minimumPartSizeInBytes);
propertyMapper.from(crt::getInitialReadBufferSizeInBytes).whenNonNull()
.to(builder::initialReadBufferSizeInBytes);
propertyMapper.from(crt::getMaxConcurrency).to(builder::maxConcurrency);
propertyMapper.from(crt::getTargetThroughputInGbps).to(builder::targetThroughputInGbps);
propertyMapper.from(crt::getMinimumPartSizeInBytes).to(builder::minimumPartSizeInBytes);
propertyMapper.from(crt::getInitialReadBufferSizeInBytes).to(builder::initialReadBufferSizeInBytes);
}

return builder.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,8 @@ S3TransferManager s3TransferManager(ObjectProvider<S3AsyncClient> s3AsyncClient)
if (this.properties.getTransferManager() != null) {
S3TransferManagerProperties transferManagerProperties = this.properties.getTransferManager();
PropertyMapper propertyMapper = PropertyMapper.get();
propertyMapper.from(transferManagerProperties::getMaxDepth).whenNonNull()
.to(builder::uploadDirectoryMaxDepth);
propertyMapper.from(transferManagerProperties::getFollowSymbolicLinks).whenNonNull()
propertyMapper.from(transferManagerProperties::getMaxDepth).to(builder::uploadDirectoryMaxDepth);
propertyMapper.from(transferManagerProperties::getFollowSymbolicLinks)
.to(builder::uploadDirectoryFollowSymbolicLinks);
}
return builder.s3Client(s3AsyncClient.getIfAvailable()).build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,11 @@ public void setCrt(@Nullable S3CrtClientProperties crt) {
public S3Configuration toS3Configuration() {
S3Configuration.Builder config = S3Configuration.builder();
PropertyMapper propertyMapper = PropertyMapper.get();
propertyMapper.from(this::getAccelerateModeEnabled).whenNonNull().to(config::accelerateModeEnabled);
propertyMapper.from(this::getChecksumValidationEnabled).whenNonNull().to(config::checksumValidationEnabled);
propertyMapper.from(this::getChunkedEncodingEnabled).whenNonNull().to(config::chunkedEncodingEnabled);
propertyMapper.from(this::getPathStyleAccessEnabled).whenNonNull().to(config::pathStyleAccessEnabled);
propertyMapper.from(this::getUseArnRegionEnabled).whenNonNull().to(config::useArnRegionEnabled);
propertyMapper.from(this::getAccelerateModeEnabled).to(config::accelerateModeEnabled);
propertyMapper.from(this::getChecksumValidationEnabled).to(config::checksumValidationEnabled);
propertyMapper.from(this::getChunkedEncodingEnabled).to(config::chunkedEncodingEnabled);
propertyMapper.from(this::getPathStyleAccessEnabled).to(config::pathStyleAccessEnabled);
propertyMapper.from(this::getUseArnRegionEnabled).to(config::useArnRegionEnabled);
return config.build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public MessagingMessageConverter<Message> messageConverter() {
}

private void configureProperties(SqsContainerOptionsBuilder options) {
PropertyMapper mapper = PropertyMapper.get().alwaysApplyingWhenNonNull();
PropertyMapper mapper = PropertyMapper.get();
mapper.from(this.sqsProperties.getQueueNotFoundStrategy()).to(options::queueNotFoundStrategy);
mapper.from(this.sqsProperties.getListener().getMaxConcurrentMessages()).to(options::maxConcurrentMessages);
mapper.from(this.sqsProperties.getListener().getMaxMessagesPerPoll()).to(options::maxMessagesPerPoll);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,18 @@
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.boot.BootstrapRegistry;
import org.springframework.boot.BootstrapRegistryInitializer;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.bootstrap.BootstrapRegistry;
import org.springframework.boot.bootstrap.BootstrapRegistryInitializer;
import org.springframework.boot.test.system.CapturedOutput;
import org.springframework.boot.test.system.OutputCaptureExtension;
import org.springframework.context.ConfigurableApplicationContext;
import org.testcontainers.containers.localstack.LocalStackContainer;
import org.testcontainers.junit.jupiter.Container;
import org.testcontainers.junit.jupiter.Testcontainers;
import org.testcontainers.localstack.LocalStackContainer;
import org.testcontainers.utility.DockerImageName;
import software.amazon.awssdk.auth.credentials.AwsBasicCredentials;
import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.*;
import static org.testcontainers.containers.localstack.LocalStackContainer.Service.S3;
import static org.testcontainers.shaded.org.awaitility.Awaitility.await;

import io.awspring.cloud.autoconfigure.AwsSyncClientCustomizer;
Expand All @@ -28,16 +27,16 @@
import java.util.Map;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.springframework.boot.BootstrapRegistry;
import org.springframework.boot.BootstrapRegistryInitializer;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.bootstrap.BootstrapRegistry;
import org.springframework.boot.bootstrap.BootstrapRegistryInitializer;
import org.springframework.context.ConfigurableApplicationContext;
import org.testcontainers.containers.localstack.LocalStackContainer;
import org.testcontainers.junit.jupiter.Container;
import org.testcontainers.junit.jupiter.Testcontainers;
import org.testcontainers.localstack.LocalStackContainer;
import org.testcontainers.shaded.com.fasterxml.jackson.core.JsonProcessingException;
import org.testcontainers.shaded.com.fasterxml.jackson.databind.ObjectMapper;
import org.testcontainers.utility.DockerImageName;
Expand Down Expand Up @@ -67,7 +66,7 @@ public class S3ConfigDataLoaderIntegrationTests {
private static String BUCKET = "test-bucket";
@Container
static LocalStackContainer localstack = new LocalStackContainer(
DockerImageName.parse("localstack/localstack:4.4.0")).withServices(S3).withReuse(true);
DockerImageName.parse("localstack/localstack:4.4.0")).withReuse(true);

@BeforeAll
static void beforeAll() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,18 @@
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.junit.jupiter.api.io.TempDir;
import org.springframework.boot.BootstrapRegistry;
import org.springframework.boot.BootstrapRegistryInitializer;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.bootstrap.BootstrapRegistry;
import org.springframework.boot.bootstrap.BootstrapRegistryInitializer;
import org.springframework.boot.test.system.CapturedOutput;
import org.springframework.boot.test.system.OutputCaptureExtension;
import org.springframework.context.ConfigurableApplicationContext;
import org.testcontainers.containers.localstack.LocalStackContainer;
import org.testcontainers.junit.jupiter.Container;
import org.testcontainers.junit.jupiter.Testcontainers;
import org.testcontainers.localstack.LocalStackContainer;
import org.testcontainers.utility.DockerImageName;
import software.amazon.awssdk.auth.credentials.AwsBasicCredentials;
import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@
import org.springframework.boot.SpringApplication;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.test.autoconfigure.actuate.observability.AutoConfigureObservability;
import org.springframework.boot.micrometer.metrics.test.autoconfigure.AutoConfigureMetrics;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.test.context.DynamicPropertyRegistry;
import org.springframework.test.context.DynamicPropertySource;
import org.testcontainers.containers.localstack.LocalStackContainer;
import org.testcontainers.junit.jupiter.Container;
import org.testcontainers.junit.jupiter.Testcontainers;
import org.testcontainers.localstack.LocalStackContainer;
import org.testcontainers.utility.DockerImageName;
import software.amazon.awssdk.services.cloudwatch.CloudWatchAsyncClient;
import software.amazon.awssdk.services.cloudwatch.model.Dimension;
Expand Down Expand Up @@ -99,7 +99,7 @@ void testCounter() {
}

@SpringBootApplication
@AutoConfigureObservability(tracing = false)
@AutoConfigureMetrics
static class Application {

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
import org.springframework.context.ApplicationContextException;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.testcontainers.containers.localstack.LocalStackContainer;
import org.testcontainers.junit.jupiter.Container;
import org.testcontainers.junit.jupiter.Testcontainers;
import org.testcontainers.localstack.LocalStackContainer;
import org.testcontainers.shaded.org.bouncycastle.util.Arrays;
import org.testcontainers.utility.DockerImageName;
import software.amazon.awssdk.services.sqs.model.QueueDoesNotExistException;
Expand Down
Loading