You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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.
The text was updated successfully, but these errors were encountered:
We could / would need to add the following attributes to @ApplicationModuleTest:
module (String) – the logical name of the module to bootstrap
classes (alias of @SpringBootTest(classes) – to explicitly point to the main application class
ModuleTestExecution would need to be altered to skip the module detection in case module is configured. Furthermore, we'd have to inspect the classes manually configured for a @SpringBootApplication annotation to detect the primary application class before falling back to the lookup via a package traversal.
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:
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 theit.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.The text was updated successfully, but these errors were encountered: