spring-projects / spring-projects/spring-framework

Support @ActiveProfiles at method level [SPR-9338]

Open
#13,977 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

in: test type: enhancement
Dominant language
Java
Stars
60.2k
Forks
38.8k
Avg merge
5d 2h
Merged PRs (30d)
27

Description

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:

  • #16647 Support @ContextConfiguration at method level
  • #18951 Support @TestPropertySource at method level

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files, tests, or entry points. Start by reviewing the related method-level requests for @ContextConfiguration and @TestPropertySource, then locate the existing class-level @ActiveProfiles handling; done means profiles can be selected per test method without requiring a separate test class.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
testing
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.