Skip to content

Relax explicit TestContextBootstrapper resolution [SPR-17006] #21544

Closed
@spring-projects-issues

Description

@spring-projects-issues

Sam Brannen opened SPR-17006 and commented

Status Quo

The resolution process for explicit TestContextBootstrapper registration via @BootstrapWith currently throws an IllegalStateException if more than one declaration of @BootstrapWith is detected.

As mentioned in Moduliths Issue #5, the resolution can be relaxed by checking the concrete types registered via @BootstrapWith.

Proposals

  1. If multiple @BootstrapWith declarations are detected but each register the exact same type of boostrapper, no exception should occur.
  2. If multiple @BootstrapWith declarations are detected and all types registered exist within the same class hierarchy, no exception should occur, and the most specific type should be used.
  3. Otherwise, throw an IllegalStateException.
  4. If @BootstrapWith is declared locally, directly on a test class, that declaration should override any such declarations that are meta-present.

Deliverables

  1. Proposal Spring core JMS pom.xml #1 already works.
  2. Consider implementing proposal Improve annotation processing thread-safety #2.
  3. Implement proposal SPR-7752 - EntityManager proxy now exposes provider specific interface. #4 (directly present annotation overrides meta-present annotations).
  4. Ensure that an exception is still thrown otherwise.

Affects: 4.3.10

Reference URL: moduliths/moduliths#5

Issue Links:

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions