Skip to content

Support @ActiveProfiles at method level [SPR-9338] #13977

@spring-projects-issues

Description

@spring-projects-issues
Collaborator

Eugen Paraschiv opened SPR-9338 and commented

It would be extremely useful if @ActiveProfiles were supported for both methods as well as entire classes; this would enable much more granular support for switching between profiles (without needing to create an new test class) which is useful for some specific use cases of profiles (where this kind of granularity makes perfect sense).


Affects: 3.1 GA

Issue Links:

Activity

spring-projects-issues

spring-projects-issues commented on May 11, 2012

@spring-projects-issues
CollaboratorAuthor

Chris Beams commented

Interesting idea. Sam, perhaps you considered this at some point? At a glance, I don't see a reason why it couldn't be supported. It would of course require creating a new ApplicationContext for any methods so annotated, but we already have precedent for that with @DirtiesContext.

Sam can weigh in about feasibility here, but as I just mentioned in #12524, this would also probably make for a good pull request if you're interested in taking a shot at it. Here's the link to the contributor guidelines again.

spring-projects-issues

spring-projects-issues commented on May 11, 2012

@spring-projects-issues
CollaboratorAuthor

Chris Beams commented

Assigning to you Sam; see my previous comment.

spring-projects-issues

spring-projects-issues commented on Jul 13, 2016

@spring-projects-issues
CollaboratorAuthor

Sam Brannen commented

This is closely related to #16647.

self-assigned this
on Jan 15, 2019
removed their assignment
on Dec 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @sbrannen@jhoeller@spring-projects-issues

        Issue actions

          Support @ActiveProfiles at method level [SPR-9338] · Issue #13977 · spring-projects/spring-framework