Skip to content

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

Closed

Description

@spring-projects-issues

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:

Activity

  1. spring-projects-issues commented on Nov 11, 2015

    @spring-projects-issues
    CollaboratorAuthor

    Sam Brannen commented

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

  2. spring-projects-issues commented on Feb 20, 2017

    @spring-projects-issues
    CollaboratorAuthor

    Réda Housni Alaoui commented

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

  3. spring-projects-issues commented on Feb 21, 2017

    @spring-projects-issues
    CollaboratorAuthor

    Réda Housni Alaoui commented

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

  4. added
    type: bug
    status: waiting-for-triage
    in: test
    and removed
    type: bug
    on Jan 11, 2019
  5. added
    status: bulk-closed
    and removed
    status: waiting-for-triage
    on Jan 11, 2019
  6. spring-projects-issues commented on Jan 12, 2019

    @spring-projects-issues
    CollaboratorAuthor

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

  7. self-assigned this
    on Jan 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

in: teststatus: bulk-closed

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions