Class ProfileValueChecker
java.lang.Object
org.junit.runners.model.Statement
org.springframework.test.context.junit4.statements.ProfileValueChecker
ProfileValueChecker
is a custom JUnit Statement
that checks
whether a test class or test method is enabled in the current environment
via Spring's @IfProfileValue
annotation.- Since:
- 4.2
- Author:
- Sam Brannen, Philippe Marschall
- See Also:
-
Constructor Summary
ConstructorDescriptionProfileValueChecker
(Statement next, Class<?> testClass, Method testMethod) Construct a newProfileValueChecker
statement. -
Method Summary
Modifier and TypeMethodDescriptionvoid
evaluate()
Determine if the test specified by arguments to the constructor is enabled in the current environment, as configured via the@IfProfileValue
annotation.
-
Constructor Details
-
ProfileValueChecker
Construct a newProfileValueChecker
statement.- Parameters:
next
- the nextStatement
in the execution chain; nevernull
testClass
- the test class to check; nevernull
testMethod
- the test method to check; may benull
if thisProfileValueChecker
is being applied at the class level
-
-
Method Details
-
evaluate
Determine if the test specified by arguments to the constructor is enabled in the current environment, as configured via the@IfProfileValue
annotation.If the test is not annotated with
@IfProfileValue
it is considered enabled.If a test is not enabled, this method will abort further evaluation of the execution chain with a failed assumption; otherwise, this method will simply evaluate the next
Statement
in the execution chain.- Specified by:
evaluate
in classStatement
- Throws:
AssumptionViolatedException
- if the test is disabledThrowable
- if evaluation of the next statement fails- See Also:
-