public static class ConnectorOutputTest.TestSpecification extends Object
| Modifier and Type | Field and Description |
|---|---|
private AtomicReference<ConnectorOutputTest.TestData> |
cachedData |
private Configuration |
config |
private Function<ConnectorOutputTest.TestSpecification,ConnectorOutputTest.TestData> |
dataSupplier |
private Configuration |
env |
private String |
name |
private AvailableVariables |
variables |
| Constructor and Description |
|---|
TestSpecification(String name,
Configuration config,
Configuration env,
Function<ConnectorOutputTest.TestSpecification,ConnectorOutputTest.TestData> dataSupplier,
AvailableVariables variables) |
| Modifier and Type | Method and Description |
|---|---|
private AvailableVariables |
builtInVariables() |
Configuration |
config()
Get the connector's configuration as would normally be passed to Kafka Connect when deploying the connector.
|
Configuration |
environment()
Get the configuration of the test environment.
|
String |
name()
Get the name of this test.
|
ConnectorOutputTest.TestSpecification |
readJsonTestData(ConnectorOutputTest.InputStreamSupplier stream)
Create a new test specification that is a copy of this specification except with the test data read from
the specified input stream.
|
ConnectorOutputTest.TestSpecification |
readJsonTestData(File file)
Create a new test specification that is a copy of this specification except with the test data read from
the specified file.
|
ConnectorOutputTest.TestSpecification |
readJsonTestData(Path path)
Create a new test specification that is a copy of this specification except with the test data read from
the specified file.
|
ConnectorOutputTest.TestData |
testData()
Get the data for this test.
|
AvailableVariables |
variables()
Get the system, environmental, and other variables.
|
ConnectorOutputTest.TestSpecification |
withConfiguration(Configuration config)
Create a new test specification that is a copy of this specification except with the given configuration.
|
ConnectorOutputTest.TestSpecification |
withConfiguration(File file)
Create a new test specification that is a copy of this specification except with the given configuration.
|
ConnectorOutputTest.TestSpecification |
withConfiguration(InputStream stream)
Create a new test specification that is a copy of this specification except with the given configuration.
|
ConnectorOutputTest.TestSpecification |
withEnvironment(Configuration env)
Create a new test specification that is a copy of this specification except with the given environment.
|
ConnectorOutputTest.TestSpecification |
withEnvironment(File file)
Create a new test specification that is a copy of this specification except with the given environment.
|
ConnectorOutputTest.TestSpecification |
withEnvironment(InputStream stream)
Create a new test specification that is a copy of this specification except with the given environment.
|
ConnectorOutputTest.TestSpecification |
withName(String name)
Create a new test specification that is a copy of this specification except with the given name.
|
ConnectorOutputTest.TestSpecification |
withReadOrWriteTestData(File file)
Create a new test specification that is a copy of this specification except with the test data read from
or able to be written to the given file.
|
ConnectorOutputTest.TestSpecification |
withReadOrWriteTestData(Path path)
Create a new test specification that is a copy of this specification except with the test data read from
or able to be written to the given file.
|
ConnectorOutputTest.TestSpecification |
withTestData(Function<ConnectorOutputTest.TestSpecification,ConnectorOutputTest.TestData> dataSupplier)
Create a new test specification that is a copy of this specification except with the given data.
|
ConnectorOutputTest.TestSpecification |
withVariables(AvailableVariables variables)
Create a new test specification that is a copy of this specification except with the given variables.
|
ConnectorOutputTest.TestSpecification |
withVariables(ConnectorOutputTest.VariableSupplier variableSupplier)
Create a new test specification that is a copy of this specification except with the given variables.
|
ConnectorOutputTest.TestSpecification |
writeJsonTestData(ConnectorOutputTest.OutputStreamSupplier stream)
Create a new test specification that is a copy of this specification except with a
ConnectorOutputTest.TestData that can capture
the connector output as expected records. |
ConnectorOutputTest.TestSpecification |
writeJsonTestData(File file)
Create a new test specification that is a copy of this specification except with a
ConnectorOutputTest.TestData that can capture
the connector output as expected records. |
ConnectorOutputTest.TestSpecification |
writeJsonTestData(Path path)
Create a new test specification that is a copy of this specification except with a
ConnectorOutputTest.TestData that can capture
the connector output as expected records. |
private final String name
private final Configuration config
private final Configuration env
private final Function<ConnectorOutputTest.TestSpecification,ConnectorOutputTest.TestData> dataSupplier
private final AvailableVariables variables
private final AtomicReference<ConnectorOutputTest.TestData> cachedData
public TestSpecification(String name, Configuration config, Configuration env, Function<ConnectorOutputTest.TestSpecification,ConnectorOutputTest.TestData> dataSupplier, AvailableVariables variables)
private AvailableVariables builtInVariables()
public String name()
public Configuration config()
public Configuration environment()
EmbeddedEngine and the
JsonConverter, JsonSerializer and JsonDeserializer instances used to read and write
the expected records, as well as the following:
public ConnectorOutputTest.TestData testData()
public AvailableVariables variables()
public ConnectorOutputTest.TestSpecification withName(String name)
name - the new namepublic ConnectorOutputTest.TestSpecification withConfiguration(Configuration config)
config - the new configurationpublic ConnectorOutputTest.TestSpecification withConfiguration(File file)
file - the configuration file; may not be nullpublic ConnectorOutputTest.TestSpecification withConfiguration(InputStream stream)
stream - the input stream to the configuration file; may not be nullpublic ConnectorOutputTest.TestSpecification withEnvironment(Configuration env)
env - the new environmentpublic ConnectorOutputTest.TestSpecification withEnvironment(File file)
file - the file containing the test environment; may not be nullpublic ConnectorOutputTest.TestSpecification withEnvironment(InputStream stream)
stream - the input stream to the file containing the test environment; may not be nullpublic ConnectorOutputTest.TestSpecification withTestData(Function<ConnectorOutputTest.TestSpecification,ConnectorOutputTest.TestData> dataSupplier)
dataSupplier - the function that returns the new data when needed, given the TestSpecification that will own it;
may be null if there is no test datapublic ConnectorOutputTest.TestSpecification withReadOrWriteTestData(Path path)
path - the path to the file where the test data can be read or to which it is to be written; may not be nullpublic ConnectorOutputTest.TestSpecification withReadOrWriteTestData(File file)
file - the file where the test data can be read or to which it is to be written; may not be nullpublic ConnectorOutputTest.TestSpecification readJsonTestData(Path path)
path - the path to the test data; may not be nullpublic ConnectorOutputTest.TestSpecification readJsonTestData(File file)
file - the test data; may not be nullpublic ConnectorOutputTest.TestSpecification readJsonTestData(ConnectorOutputTest.InputStreamSupplier stream)
test
data is read.stream - the supplier to the stream of test data; may not be nullpublic ConnectorOutputTest.TestSpecification writeJsonTestData(Path path)
ConnectorOutputTest.TestData that can capture
the connector output as expected records.path - the path to the file to which the test data is to be written; may not be nullpublic ConnectorOutputTest.TestSpecification writeJsonTestData(File file)
ConnectorOutputTest.TestData that can capture
the connector output as expected records.file - the file to which the test data is to be written; may not be nullpublic ConnectorOutputTest.TestSpecification writeJsonTestData(ConnectorOutputTest.OutputStreamSupplier stream)
ConnectorOutputTest.TestData that can capture
the connector output as expected records.stream - the stream to which the test data is to be written; may not be nullpublic ConnectorOutputTest.TestSpecification withVariables(AvailableVariables variables)
variables - the new variables that should replace this specification's variablespublic ConnectorOutputTest.TestSpecification withVariables(ConnectorOutputTest.VariableSupplier variableSupplier)
variableSupplier - the function used to obtain the variables using the configurationCopyright © 2018 JBoss by Red Hat. All rights reserved.