Skip to content

@ContextConfiguration defined on a base class and a composed annotation do not merge [SPR-13670] #18245

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
spring-projects-issues opened this issue Nov 11, 2015 · 4 comments
Assignees
Labels
in: test Issues in the test module status: bulk-closed An outdated, unresolved issue that's closed in bulk as part of a cleaning process

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Nov 11, 2015

Alain Sahli opened SPR-13670 and commented

When a test has multiple @ContextConfiguration annotations defined on a base class and a composed annotation then the one defined on the composed annotation is ignored.

I created a small example that illustrates the issue (see reference URL). In this case the TestAppContext defined on the ComposedAnnotation is ignored and therefore the ComposedAnnotationTest fails because the needed bean does not exist.

If the test class is directly annotated with @ContextConfiguration instead of using the ComposedAnnotation it works (see WorkingTest).


Affects: 4.1.7

Reference URL: https://gist.github.com/alainsahli/a3d8fd26adc527aa422c

Issue Links:

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Nov 11, 2015

Sam Brannen commented

This is a duplicate of #17346 and has been addressed in Spring Framework 4.2.

@spring-projects-issues
Copy link
Collaborator Author

Réda Housni Alaoui commented

Hello, I am experiencing the same issue in 4.3.0.RELEASE.
@TestExecutionListeners are correctly merged but not @ContextConfiguration.

@spring-projects-issues
Copy link
Collaborator Author

Réda Housni Alaoui commented

In fact, I have a different issue.
You can close it, sorry. Creating another issue.

@spring-projects-issues spring-projects-issues added type: bug A general bug status: waiting-for-triage An issue we've not yet triaged or decided on in: test Issues in the test module labels Jan 11, 2019
@spring-projects-issues spring-projects-issues removed the type: bug A general bug label Jan 11, 2019
@rstoyanchev rstoyanchev added status: bulk-closed An outdated, unresolved issue that's closed in bulk as part of a cleaning process and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Jan 11, 2019
@spring-projects-issues
Copy link
Collaborator Author

Bulk closing outdated, unresolved issues. Please, reopen if still relevant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: test Issues in the test module status: bulk-closed An outdated, unresolved issue that's closed in bulk as part of a cleaning process
Projects
None yet
Development

No branches or pull requests

3 participants