org.springframework.test.context

Interface ActiveProfilesResolver

  • All Known Implementing Classes:
    DefaultActiveProfilesResolver
    Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.


    @FunctionalInterface
    public interface ActiveProfilesResolver
    Strategy interface for programmatically resolving which active bean definition profiles should be used when loading an ApplicationContext for a test class.

    A custom ActiveProfilesResolver can be registered via the resolver attribute of @ActiveProfiles.

    Concrete implementations must provide a public no-args constructor.

    Since:
    4.0
    Author:
    Sam Brannen, Michail Nikolaev
    See Also:
    ActiveProfiles
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method and Description
      java.lang.String[] resolve(java.lang.Class<?> testClass)
      Resolve the bean definition profiles to use when loading an ApplicationContext for the given test class.
    • Method Detail

      • resolve

        java.lang.String[] resolve(java.lang.Class<?> testClass)
        Resolve the bean definition profiles to use when loading an ApplicationContext for the given test class.
        Parameters:
        testClass - the test class for which the profiles should be resolved; never null
        Returns:
        the list of bean definition profiles to use when loading the ApplicationContext; never null
        See Also:
        ActiveProfiles.resolver(), ActiveProfiles.inheritProfiles()