Skip to content

Commit

Permalink
feat : upgrade localstack
Browse files Browse the repository at this point in the history
  • Loading branch information
rajadilipkolli committed Dec 1, 2024
1 parent ab5e365 commit 600ce40
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion aws-sns-project/docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '3.8'
services:

localstack:
image: localstack/localstack:3.8.1
image: localstack/localstack:4.0.3
ports:
- "4566:4566"
environment:
Expand Down
2 changes: 1 addition & 1 deletion aws-sns-project/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@
<configuration>
<java>
<palantirJavaFormat>
<version>2.47.0</version>
<version>2.50.0</version>
</palantirJavaFormat>
<importOrder />
<removeUnusedImports />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,26 @@
import static io.awspring.cloud.sns.configuration.NotificationHandlerMethodArgumentResolverConfigurationUtils.getNotificationHandlerMethodArgumentResolver;

import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Configuration;
import org.springframework.lang.NonNull;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import software.amazon.awssdk.services.sns.SnsClient;

@Configuration(proxyBeanMethods = false)
@RequiredArgsConstructor
class WebMvcConfig implements WebMvcConfigurer {

private final ApplicationProperties properties;
private final SnsClient snsClient;

public WebMvcConfig(ApplicationProperties properties, SnsClient snsClient) {
this.properties = properties;
this.snsClient = snsClient;
}

@Override
public void addCorsMappings(CorsRegistry registry) {
public void addCorsMappings(@NonNull CorsRegistry registry) {
registry.addMapping(properties.getCors().getPathPattern())
.allowedMethods(properties.getCors().getAllowedMethods())
.allowedHeaders(properties.getCors().getAllowedHeaders())
Expand All @@ -27,7 +31,7 @@ public void addCorsMappings(CorsRegistry registry) {
}

@Override
public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
public void addArgumentResolvers(@NonNull List<HandlerMethodArgumentResolver> argumentResolvers) {
argumentResolvers.add(getNotificationHandlerMethodArgumentResolver(snsClient));
}
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
package com.learning.awssns;

import com.learning.awssns.common.ContainersConfig;
import com.learning.awssns.utils.AppConstants;
import org.springframework.boot.SpringApplication;

public class TestSNSApplication {

public static void main(String[] args) {
System.setProperty("spring.profiles.active", "local");
SpringApplication.from(SNSApplication::main)
.with(ContainersConfig.class)
.withAdditionalProfiles(AppConstants.PROFILE_LOCAL)
.run(args);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ public class ContainersConfig {
@ServiceConnection
LocalStackContainer localstackContainer() {
return new LocalStackContainer(
DockerImageName.parse("localstack/localstack").withTag("3.7.2"));
DockerImageName.parse("localstack/localstack").withTag("4.0.3"));
}
}

0 comments on commit 600ce40

Please sign in to comment.