Skip to content

Commit

Permalink
feat : upgrade test cases to 4.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
rajadilipkolli committed Dec 27, 2024
1 parent ecd0d8c commit 59b4b3b
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class TestApplication {
@Bean
@ServiceConnection
PostgreSQLContainer<?> sqlContainer() {
return new PostgreSQLContainer<>(DockerImageName.parse("postgres:17.0-alpine"));
return new PostgreSQLContainer<>(DockerImageName.parse("postgres:17.2-alpine"));
}

public static void main(String[] args) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class LocalStackContainerConfig {

@Container
private static final LocalStackContainer localStackContainer =
new LocalStackContainer(DockerImageName.parse("localstack/localstack").withTag("3.7.2"))
new LocalStackContainer(DockerImageName.parse("localstack/localstack").withTag("4.0.3"))
.withCopyFileToContainer(
MountableFile.forHostPath("localstack/"),
"/etc/localstack/init/ready.d/")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Configuration;
import org.springframework.lang.NonNull;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

Expand All @@ -11,7 +12,7 @@ public class WebMvcConfig implements WebMvcConfigurer {
private final ApplicationProperties properties;

@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 Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class TestApplication {
@ServiceConnection
LocalStackContainer localStackContainer() {
return new LocalStackContainer(
DockerImageName.parse("localstack/localstack").withTag("3.7.2"))
DockerImageName.parse("localstack/localstack").withTag("4.0.3"))
.withCopyFileToContainer(
MountableFile.forHostPath("localstack/"), "/etc/localstack/init/ready.d/")
.waitingFor(Wait.forLogMessage(".*LocalStack initialized successfully\n", 1));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class LocalStackContainerConfig {

@Container
private static final LocalStackContainer localStackContainer =
new LocalStackContainer(DockerImageName.parse("localstack/localstack").withTag("3.7.1"))
new LocalStackContainer(DockerImageName.parse("localstack/localstack").withTag("4.0.3"))
.withCopyFileToContainer(
MountableFile.forHostPath("localstack/"),
"/etc/localstack/init/ready.d/")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,10 @@
import javax.sql.DataSource;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase;
import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase.Replace;
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
import org.springframework.boot.testcontainers.context.ImportTestcontainers;

@DataJpaTest(properties = "spring.jpa.hibernate.ddl-auto=validate")
@AutoConfigureTestDatabase(replace = Replace.NONE)
@ImportTestcontainers(DBTestContainer.class)
class SchemaValidationTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Configuration;
import org.springframework.lang.NonNull;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

Expand All @@ -11,7 +12,7 @@ public class WebMvcConfig implements WebMvcConfigurer {
private final ApplicationProperties properties;

@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 Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class LocalStackTestContainer {
LocalStackContainer localStackContainer() {
LocalStackContainer localStackContainer =
new LocalStackContainer(
DockerImageName.parse("localstack/localstack").withTag("3.7.2"));
DockerImageName.parse("localstack/localstack").withTag("4.0.3"));
localStackContainer.start();
Slf4jLogConsumer logConsumer = new Slf4jLogConsumer(log);
localStackContainer.followOutput(logConsumer);
Expand Down

0 comments on commit 59b4b3b

Please sign in to comment.