Class ProfileValueUtils
java.lang.Object
org.springframework.test.annotation.ProfileValueUtils
General utility methods for working with profile values.
- Since:
- 2.5
- Author:
- Sam Brannen, Juergen Hoeller
- See Also:
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic booleanisTestEnabledInThisEnvironment(Class<?> testClass) Determine if the suppliedtestClassis enabled in the current environment, as specified by the@IfProfileValueannotation at the class level.static booleanisTestEnabledInThisEnvironment(Method testMethod, Class<?> testClass) Determine if the suppliedtestMethodis enabled in the current environment, as specified by the@IfProfileValueannotation, which may be declared on the test method itself or at the class level.static booleanisTestEnabledInThisEnvironment(ProfileValueSource profileValueSource, Method testMethod, Class<?> testClass) Determine if the suppliedtestMethodis enabled in the current environment, as specified by the@IfProfileValueannotation, which may be declared on the test method itself or at the class level.static ProfileValueSourceretrieveProfileValueSource(Class<?> testClass) Retrieves theProfileValueSourcetype for the specifiedtest classas configured via the@ProfileValueSourceConfigurationannotation and instantiates a new instance of that type.
- 
Constructor Details- 
ProfileValueUtilspublic ProfileValueUtils()
 
- 
- 
Method Details- 
retrieveProfileValueSourceRetrieves theProfileValueSourcetype for the specifiedtest classas configured via the@ProfileValueSourceConfigurationannotation and instantiates a new instance of that type.If @ProfileValueSourceConfigurationis not present on the specified class or if a customProfileValueSourceis not declared, the defaultSystemProfileValueSourcewill be returned instead.- Parameters:
- testClass- the test class for which the ProfileValueSource should be retrieved
- Returns:
- the configured (or default) ProfileValueSource for the specified class
- See Also:
 
- 
isTestEnabledInThisEnvironmentDetermine if the suppliedtestClassis enabled in the current environment, as specified by the@IfProfileValueannotation at the class level.Defaults to trueif no@IfProfileValueannotation is declared.- Parameters:
- testClass- the test class
- Returns:
- trueif the test is enabled in the current environment
 
- 
isTestEnabledInThisEnvironmentDetermine if the suppliedtestMethodis enabled in the current environment, as specified by the@IfProfileValueannotation, which may be declared on the test method itself or at the class level. Class-level usage overrides method-level usage.Defaults to trueif no@IfProfileValueannotation is declared.- Parameters:
- testMethod- the test method
- testClass- the test class
- Returns:
- trueif the test is enabled in the current environment
 
- 
isTestEnabledInThisEnvironmentpublic static boolean isTestEnabledInThisEnvironment(ProfileValueSource profileValueSource, Method testMethod, Class<?> testClass) Determine if the suppliedtestMethodis enabled in the current environment, as specified by the@IfProfileValueannotation, which may be declared on the test method itself or at the class level. Class-level usage overrides method-level usage.Defaults to trueif no@IfProfileValueannotation is declared.- Parameters:
- profileValueSource- the ProfileValueSource to use to determine if the test is enabled
- testMethod- the test method
- testClass- the test class
- Returns:
- trueif the test is enabled in the current environment
 
 
-