Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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 aws-lambda-project/docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ services:
- aws-lambda

localstack:
image: localstack/localstack:3.8.1
image: localstack/localstack:4.0.3
ports:
- "127.0.0.1:4566:4566" # LocalStack Gateway
- "127.0.0.1:4510-4559:4510-4559" # external services port range
Expand Down
2 changes: 1 addition & 1 deletion aws-lambda-project/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

<java.version>21</java.version>
<spring-cloud.version>2023.0.4</spring-cloud.version>
<spring-cloud.version>2024.0.0</spring-cloud.version>
<spring-cloud-aws.version>3.2.1</spring-cloud-aws.version>
<springdoc-openapi.version>2.2.0</springdoc-openapi.version>
<wrapper.version>1.0.31.RELEASE</wrapper.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ class ApplicationIntegrationTest {
static Network network = Network.newNetwork();

@Container
static PostgreSQLContainer<?> postgres = new PostgreSQLContainer<>("postgres:16.4-alpine")
static PostgreSQLContainer<?> postgres = new PostgreSQLContainer<>("postgres:17.2-alpine")
.withNetwork(network)
.withNetworkAliases("postgres")
.withReuse(true);

@Container
static LocalStackContainer localstack = new LocalStackContainer(
DockerImageName.parse("localstack/localstack").withTag("3.7.2"))
DockerImageName.parse("localstack/localstack").withTag("4.0.3"))
.withNetwork(network)
.withEnv("LOCALSTACK_HOST", "localhost.localstack.cloud")
.withEnv("LAMBDA_DOCKER_NETWORK", ((Network.NetworkImpl) network).getName())
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,24 @@
package com.learning.awslambda;

import static org.assertj.core.api.Assertions.assertThat;

import com.learning.awslambda.common.ContainersConfig;
import com.zaxxer.hikari.HikariDataSource;
import javax.sql.DataSource;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
import org.springframework.context.annotation.Import;

@DataJpaTest(properties = {"spring.jpa.hibernate.ddl-auto=validate", "spring.test.database.replace=none"})
@DataJpaTest(properties = {"spring.jpa.hibernate.ddl-auto=validate"})
@Import(ContainersConfig.class)
class SchemaValidationTest {

@Autowired
DataSource dataSource;

@Test
void validateJpaMappingsWithDbSchema() {}
void validateJpaMappingsWithDbSchema() {
assertThat(dataSource).isInstanceOf(HikariDataSource.class);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ public class ContainersConfig {
@Bean
@ServiceConnection
PostgreSQLContainer<?> postgreSQLContainer() {
return new PostgreSQLContainer<>(DockerImageName.parse("postgres:17.0-alpine"));
return new PostgreSQLContainer<>(DockerImageName.parse("postgres:17.2-alpine"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.bean.override.mockito.MockitoBean;
import org.springframework.test.web.servlet.MockMvc;

@WebMvcTest(controllers = ActorController.class)
Expand All @@ -28,7 +28,7 @@ class ActorControllerTest {
@Autowired
private MockMvc mockMvc;

@MockBean
@MockitoBean
private ActorService actorService;

@Autowired
Expand Down
Loading