Class TestParameterValuesProvider
java.lang.Object
com.google.testing.junit.testparameterinjector.TestParameterValuesProvider
- All Implemented Interfaces:
TestParameter.TestParameterValuesProvider
public abstract class TestParameterValuesProvider
extends Object
implements TestParameter.TestParameterValuesProvider
Abstract class for custom providers of @TestParameter values.
This is a replacement for TestParameter.TestParameterValuesProvider
, which is
deprecated. The difference with the former interface is that this class provides a
Context
instance when invoking provideValues(com.google.testing.junit.testparameterinjector.TestParameterValuesProvider.Context)
.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
An immutable value class that contains extra information about the context of the parameter for which values are being provided. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal List<?>
Deprecated.protected abstract List<?>
final TestParameterValue
Wraps the given value in an object that allows you to give the parameter value a different name.
-
Constructor Details
-
TestParameterValuesProvider
public TestParameterValuesProvider()
-
-
Method Details
-
provideValues
protected abstract List<?> provideValues(TestParameterValuesProvider.Context context) throws Exception - Throws:
Exception
-
provideValues
Deprecated.This method should never be called as it will simply throw anUnsupportedOperationException
.- Specified by:
provideValues
in interfaceTestParameter.TestParameterValuesProvider
-
value
Wraps the given value in an object that allows you to give the parameter value a different name. The TestParameterInjector framework will recognize the returnedTestParameterValue
instances and unwrap them at injection time.Usage:
value(file.content).withName(file.name)
.- Specified by:
value
in interfaceTestParameter.TestParameterValuesProvider
-
UnsupportedOperationException
.