Skip to content

Conversation

@mshima
Copy link
Member

@mshima mshima commented Jan 16, 2026


Please make sure the below checklist is followed for Pull Requests.

When you are still working on the PR, consider converting it to Draft (below reviewers) and adding skip-ci label, you can still see CI build result at your branch.

@mshima mshima force-pushed the serviceconnection branch 4 times, most recently from 3c6674a to 8a2162f Compare January 16, 2026 10:58
@mshima mshima force-pushed the serviceconnection branch from 8a2162f to ecf1f3e Compare January 16, 2026 11:13
Copy link

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

This pull request migrates MongoDB integration tests to use Spring Boot's @ServiceConnection annotation, simplifying testcontainer configuration by eliminating the need for manual property registration via @DynamicPropertySource.

Changes:

  • Refactored MongoDB testcontainer configuration to use @ServiceConnection annotation
  • Renamed MongoDbTestContainer to DatabaseTestcontainer for consistency
  • Removed manual property source registration and updated test annotations across multiple test files

Reviewed changes

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

Show a summary per file
File Description
generators/spring-data/generators/mongodb/templates/src/test/java/package/config/DatabaseTestcontainer.java.ejs Renamed from MongoDbTestContainer, added @Serviceconnection annotation, removed @DynamicPropertySource method
generators/spring-data/generators/mongodb/generator.ts Added cleanup for old MongoDbTestContainer.java file, removed integrationTest task that manually added annotations
generators/spring-data/generators/mongodb/files.ts Updated template file reference to new DatabaseTestcontainer.java name
generators/spring-data/generators/mongodb/snapshots/generator.spec.ts.snap Updated snapshots to reflect renamed file
generators/spring-boot/templates/src/test/java/package/web/rest/AccountResourceIT.java.ejs Added @testcontainers and @ImportTestcontainers annotations for MongoDB, added necessary imports
generators/spring-boot/templates/src/test/java/package/entityPackage/web/rest/_entityClass_ResourceIT.java.ejs Added @testcontainers and @ImportTestcontainers annotations for MongoDB, added necessary imports
generators/spring-boot/templates/src/test/java/package/entityPackage/web/rest/UserResourceIT.java.ejs Added @testcontainers and @ImportTestcontainers annotations for MongoDB, added necessary imports
generators/spring-boot/templates/src/test/java/package/entityPackage/web/rest/PublicUserResourceIT.java.ejs Added @testcontainers and @ImportTestcontainers annotations for MongoDB, added necessary imports
generators/spring-boot/templates/src/test/java/package/entityPackage/service/UserServiceIT.java.ejs Added @testcontainers and @ImportTestcontainers annotations for MongoDB, added necessary imports
generators/spring-boot/templates/pom.xml.ejs Changed webapp profile spring.profiles.active from "dev" to "test"
generators/spring-boot/generators/cucumber/templates/src/test/java/package/cucumber/CucumberTestContextConfiguration.java.ejs Added @testcontainers and @ImportTestcontainers annotations for MongoDB, added necessary imports

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

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant