Skip to content

Allow using @ApplicationModuleTest outside of a module package #466

@odrotbohm

Description

@odrotbohm

Discussed in #413

Originally posted by marinusgeuze December 11, 2023
Hi,

In our project, we have organized our tests into different root packages based on their types, such as unit tests, integration tests, and end-to-end tests. Consequently, our Spring Boot Integration Tests are placed in a package different from their corresponding modules, leading to the occurrence of the “Package %s is not part of any module!” error.

To provide more context, our test package structure looks something like this:

unit.com.test..*UnitTest
it.com.test..*IntegrationTest
end2end.com.test..*End2EndTest

We are seeking a solution to explicitly define the module to which a Spring Boot Integration Test belongs. This as part of the ApplicationModuleTest annotation. Or ideally, we would like to add the it.com.test package to the module. Is there a way to achieve this?

We acknowledge that a possible recommendation might be to group tests within the module boundaries, like com.test..unit.*UnitTest, com.test..it.*IntegrationTest, etc. However, this is not a feasible option for us due to the configuration constraints of our test frameworks.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions