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
Calculating base packages should return the common parent package, even if it is the default (no) package.
In BasePackageCalculator.calculateBasePackage(List<JavaSource> javaSources)
Why it needs to be done
For e.g. two classes com.acme.some.A and com.acme.other.B the current calculation does fail as it does not recognize com.acme as possible common base package.
Acceptance Criteria
Given base package should be calculated for an application When two classes com.acme.some.A and com.acme.other.B exist Then the returned base package should be com.acme
Given base package should be calculated for an application When two classes com.acme.some.A and com.example.other.B exist Then the returned base package should be com
Given base package should be calculated for an application When two classes com.acme.some.A and org.example.other.B exist Then the returned base package should be ""
See JavaSourceSetImplTest.getBasePackageShouldReturnDefaultIfNoDistinctRootPackageExists()
This test should expect com.vmware.sbm instead of the default base package.
Additional Information
All recipes/actions calculating the base package for Spring components and configurations should check if the returned base package is the default package/empty and handle this situation. At least initialize-spring-boot-migration would be affected.
For Spring applications to work without one common base package, a @ComponentScan could be used.
The text was updated successfully, but these errors were encountered:
What needs to be done
Calculating base packages should return the common parent package, even if it is the default (no) package.
In
BasePackageCalculator.calculateBasePackage(List<JavaSource> javaSources)
Why it needs to be done
For e.g. two classes
com.acme.some.A
andcom.acme.other.B
the current calculation does fail as it does not recognizecom.acme
as possible common base package.Acceptance Criteria
Given base package should be calculated for an application
When two classes
com.acme.some.A
andcom.acme.other.B
existThen the returned base package should be
com.acme
Given base package should be calculated for an application
When two classes
com.acme.some.A
andcom.example.other.B
existThen the returned base package should be
com
Given base package should be calculated for an application
When two classes
com.acme.some.A
andorg.example.other.B
existThen the returned base package should be
""
See
JavaSourceSetImplTest.getBasePackageShouldReturnDefaultIfNoDistinctRootPackageExists()
This test should expect
com.vmware.sbm
instead of the default base package.Additional Information
All recipes/actions calculating the base package for Spring components and configurations should check if the returned base package is the default package/empty and handle this situation. At least
initialize-spring-boot-migration
would be affected.For Spring applications to work without one common base package, a
@ComponentScan
could be used.The text was updated successfully, but these errors were encountered: