Skip to content

feat(tests): add UserGetByIdContainerTest with PostgreSQL integration#60

Open
Theo-lbg wants to merge 2 commits intomainfrom
feat/testContainer
Open

feat(tests): add UserGetByIdContainerTest with PostgreSQL integration#60
Theo-lbg wants to merge 2 commits intomainfrom
feat/testContainer

Conversation

@Theo-lbg
Copy link
Copy Markdown
Collaborator

@Theo-lbg Theo-lbg commented Apr 1, 2026

No description provided.

@Theo-lbg Theo-lbg linked an issue Apr 1, 2026 that may be closed by this pull request
@Theo-lbg Theo-lbg marked this pull request as ready for review April 1, 2026 12:57
Copilot AI review requested due to automatic review settings April 1, 2026 12:57
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new Spring Boot + Testcontainers integration test to validate the GET /random-users/{id} endpoint against a real PostgreSQL instance, and updates Maven test dependencies to support container-based testing.

Changes:

  • Introduce UserGetByIdContainerTest using @SpringBootTest + TestRestTemplate + PostgreSQLContainer.
  • Add Testcontainers (BOM + JUnit Jupiter + PostgreSQL module) and Spring Boot Testcontainers support to pom.xml.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/test/java/com/xpeho/spring_boot_java_random_user/presentation/UserGetByIdContainerTest.java New PostgreSQL Testcontainers-based integration test covering 200/404 for GET /random-users/{id}.
pom.xml Adds Testcontainers dependency management and test-scoped dependencies required for the new container test.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sonarqube-xpeho
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create test container for get /user/{id}

3 participants