diff --git a/.gitpod.Dockerfile b/.gitpod.Dockerfile index 2101497a..274ae2e5 100644 --- a/.gitpod.Dockerfile +++ b/.gitpod.Dockerfile @@ -3,5 +3,5 @@ FROM gitpod/workspace-full:latest USER gitpod RUN bash -c ". /home/gitpod/.sdkman/bin/sdkman-init.sh \ - && sdk install java 21.0.2-tem \ - && sdk default java 21.0.2-tem" + && sdk install java 21.0.4-tem \ + && sdk default java 21.0.4-tem" diff --git a/aws-sns-project/docker/docker-compose.yml b/aws-sns-project/docker/docker-compose.yml index b047e7ad..26c49e40 100644 --- a/aws-sns-project/docker/docker-compose.yml +++ b/aws-sns-project/docker/docker-compose.yml @@ -2,7 +2,7 @@ version: '3.8' services: localstack: - image: localstack/localstack:3.6.0 + image: localstack/localstack:3.7.0 ports: - "4566:4566" environment: diff --git a/aws-sns-project/src/main/java/com/learning/awssns/Application.java b/aws-sns-project/src/main/java/com/learning/awssns/SNSApplication.java similarity index 82% rename from aws-sns-project/src/main/java/com/learning/awssns/Application.java rename to aws-sns-project/src/main/java/com/learning/awssns/SNSApplication.java index 00fbd076..6d7384be 100644 --- a/aws-sns-project/src/main/java/com/learning/awssns/Application.java +++ b/aws-sns-project/src/main/java/com/learning/awssns/SNSApplication.java @@ -7,9 +7,9 @@ @SpringBootApplication @EnableConfigurationProperties({ApplicationProperties.class}) -public class Application { +public class SNSApplication { public static void main(String[] args) { - SpringApplication.run(Application.class, args); + SpringApplication.run(SNSApplication.class, args); } } diff --git a/aws-sns-project/src/main/java/com/learning/awssns/config/Initializer.java b/aws-sns-project/src/main/java/com/learning/awssns/config/Initializer.java index 1916ea53..6067d829 100644 --- a/aws-sns-project/src/main/java/com/learning/awssns/config/Initializer.java +++ b/aws-sns-project/src/main/java/com/learning/awssns/config/Initializer.java @@ -8,7 +8,7 @@ @Component @RequiredArgsConstructor @Slf4j -public class Initializer implements CommandLineRunner { +class Initializer implements CommandLineRunner { private final ApplicationProperties properties; diff --git a/aws-sns-project/src/main/java/com/learning/awssns/config/SwaggerConfig.java b/aws-sns-project/src/main/java/com/learning/awssns/config/SwaggerConfig.java index 40438777..37c837d1 100644 --- a/aws-sns-project/src/main/java/com/learning/awssns/config/SwaggerConfig.java +++ b/aws-sns-project/src/main/java/com/learning/awssns/config/SwaggerConfig.java @@ -7,4 +7,4 @@ @Configuration(proxyBeanMethods = false) @OpenAPIDefinition(info = @Info(title = "aws-sns-project", version = "v1"), servers = @Server(url = "/")) -public class SwaggerConfig {} +class SwaggerConfig {} diff --git a/aws-sns-project/src/main/java/com/learning/awssns/config/WebMvcConfig.java b/aws-sns-project/src/main/java/com/learning/awssns/config/WebMvcConfig.java index b2239d12..d0759b4f 100644 --- a/aws-sns-project/src/main/java/com/learning/awssns/config/WebMvcConfig.java +++ b/aws-sns-project/src/main/java/com/learning/awssns/config/WebMvcConfig.java @@ -10,9 +10,9 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; import software.amazon.awssdk.services.sns.SnsClient; -@Configuration +@Configuration(proxyBeanMethods = false) @RequiredArgsConstructor -public class WebMvcConfig implements WebMvcConfigurer { +class WebMvcConfig implements WebMvcConfigurer { private final ApplicationProperties properties; private final SnsClient snsClient; diff --git a/aws-sns-project/src/main/java/com/learning/awssns/utils/AppConstants.java b/aws-sns-project/src/main/java/com/learning/awssns/utils/AppConstants.java index b38bf1eb..69a7fe73 100644 --- a/aws-sns-project/src/main/java/com/learning/awssns/utils/AppConstants.java +++ b/aws-sns-project/src/main/java/com/learning/awssns/utils/AppConstants.java @@ -1,12 +1,6 @@ package com.learning.awssns.utils; public final class AppConstants { - public static final String PROFILE_PROD = "prod"; - public static final String PROFILE_NOT_PROD = "!" + PROFILE_PROD; + public static final String PROFILE_LOCAL = "local"; public static final String PROFILE_TEST = "test"; - public static final String PROFILE_NOT_TEST = "!" + PROFILE_TEST; - public static final String DEFAULT_PAGE_NUMBER = "0"; - public static final String DEFAULT_PAGE_SIZE = "10"; - public static final String DEFAULT_SORT_BY = "id"; - public static final String DEFAULT_SORT_DIRECTION = "asc"; } diff --git a/aws-sns-project/src/main/resources/application.properties b/aws-sns-project/src/main/resources/application.properties index eb8b675b..5da48ffb 100644 --- a/aws-sns-project/src/main/resources/application.properties +++ b/aws-sns-project/src/main/resources/application.properties @@ -1,7 +1,7 @@ spring.application.name=aws-sns-project server.port=8080 server.shutdown=graceful -spring.main.allow-bean-definition-overriding=true + spring.jmx.enabled=false spring.mvc.problemdetails.enabled=true spring.threads.virtual.enabled=true diff --git a/aws-sns-project/src/test/java/com/learning/awssns/TestApplication.java b/aws-sns-project/src/test/java/com/learning/awssns/TestSNSApplication.java similarity index 60% rename from aws-sns-project/src/test/java/com/learning/awssns/TestApplication.java rename to aws-sns-project/src/test/java/com/learning/awssns/TestSNSApplication.java index b1823466..27fec876 100644 --- a/aws-sns-project/src/test/java/com/learning/awssns/TestApplication.java +++ b/aws-sns-project/src/test/java/com/learning/awssns/TestSNSApplication.java @@ -3,10 +3,12 @@ import com.learning.awssns.common.ContainersConfig; import org.springframework.boot.SpringApplication; -public class TestApplication { +public class TestSNSApplication { public static void main(String[] args) { System.setProperty("spring.profiles.active", "local"); - SpringApplication.from(Application::main).with(ContainersConfig.class).run(args); + SpringApplication.from(SNSApplication::main) + .with(ContainersConfig.class) + .run(args); } } diff --git a/aws-sns-project/src/test/java/com/learning/awssns/common/ContainersConfig.java b/aws-sns-project/src/test/java/com/learning/awssns/common/ContainersConfig.java index ef5f68c8..ba856e11 100644 --- a/aws-sns-project/src/test/java/com/learning/awssns/common/ContainersConfig.java +++ b/aws-sns-project/src/test/java/com/learning/awssns/common/ContainersConfig.java @@ -14,6 +14,6 @@ public class ContainersConfig { @ServiceConnection LocalStackContainer localstackContainer(DynamicPropertyRegistry registry) { return new LocalStackContainer( - DockerImageName.parse("localstack/localstack").withTag("3.6.0")); + DockerImageName.parse("localstack/localstack").withTag("3.7.0")); } } diff --git a/aws-sqs-project/src/main/java/com/learning/awspring/config/SpringAsyncConfig.java b/aws-sqs-project/src/main/java/com/learning/awspring/config/SpringAsyncConfig.java index 140df593..b68acf45 100644 --- a/aws-sqs-project/src/main/java/com/learning/awspring/config/SpringAsyncConfig.java +++ b/aws-sqs-project/src/main/java/com/learning/awspring/config/SpringAsyncConfig.java @@ -22,10 +22,10 @@ public Executor getAsyncExecutor() { @Override public AsyncUncaughtExceptionHandler getAsyncUncaughtExceptionHandler() { return (throwable, method, params) -> { - log.error("Exception message - " + throwable.getMessage()); - log.error("Method name - " + method.getName()); + log.error("Exception message - {}", throwable.getMessage()); + log.error("Method name - {}", method.getName()); for (Object param : params) { - log.error("Parameter value - " + param); + log.error("Parameter value - {}", param); } }; } diff --git a/aws-sqs-project/src/main/java/com/learning/awspring/utils/AppConstants.java b/aws-sqs-project/src/main/java/com/learning/awspring/utils/AppConstants.java index 0960f71c..af2a767a 100644 --- a/aws-sqs-project/src/main/java/com/learning/awspring/utils/AppConstants.java +++ b/aws-sqs-project/src/main/java/com/learning/awspring/utils/AppConstants.java @@ -1,11 +1,10 @@ package com.learning.awspring.utils; public final class AppConstants { - public static final String PROFILE_LOCAL = "local"; + public static final String PROFILE_PROD = "prod"; public static final String PROFILE_NOT_PROD = "!" + PROFILE_PROD; public static final String PROFILE_TEST = "test"; - public static final String PROFILE_IT = "integration-test"; // Name of the queue. Developers are free to choose their queue name. ( // "http://localhost:4566/000000000000/spring-boot-amazon-sqs") public static final String QUEUE = "spring-boot-amazon-sqs"; diff --git a/aws-sqs-project/src/main/resources/application.yml b/aws-sqs-project/src/main/resources/application.yml index ebf7e7c4..5a62d0ac 100644 --- a/aws-sqs-project/src/main/resources/application.yml +++ b/aws-sqs-project/src/main/resources/application.yml @@ -1,6 +1,6 @@ logging: file: - name: logs/aws-sqs-project.log + name: logs/${spring.application.name}.log level: com: amazonaws: