Кажется, что параметры цитрусовых вводятся в передаваемые параметры поставщика данных, поэтому поставщику данных необходимо включить пространство для параметров цитрусовых.
found https://github.com/citrusframework/citrus/commit/952204eaacf672677a01cc66f3385f64cd08f8d4, который имел исправление для передачи переменных цитрусовых с поставщиком данных, но, что более важно / полезно для меня, модульные тесты. Таким образом, он играет с модульными тестами и выглядит так, как будто в поставщике данных требуется нулевое значение для каждой вводимой / передаваемой переменной цитрусовых.
@DataProvider(name = "todoDataProvider")
public Object[][] todoDataProvider() {
return new Object[][] {
new String[] {"todo1", "Description: todo1", null},
new String[] {"todo2", "Description: todo2", null},
new String[] {"todo3", "Description: todo3", null}
};
}
@Test(dataProvider = "todoDataProvider")
@CitrusTest
@Parameters({"name", "description", "context"})
public void testProvider(
String name, String description, @CitrusResource @Optional TestContext context) {
variable("todoId", "citrus:randomUUID()");
// this.name(todoName);
echo(name);
}
@Test(dataProvider = "testData")
@Parameters({"data", "temp", "runner", "context"})
@CitrusTest
public void injectResourceRunnerCombinedWithParameter(
String data,
String test,
@CitrusResource TestRunner testRunner,
@CitrusResource TestContext context) {
final String number = Functions.randomNumber(10L, context);
context.setVariable("message", "Injection worked!");
testRunner.echo("${message}");
testRunner.echo("${data}");
testRunner.createVariable("random", number);
testRunner.run(
new AbstractTestAction() {
@Override
public void doExecute(TestContext context) {
Assert.assertEquals(context.getVariable("random"), number);
}
});
}
@DataProvider
public Object[][] testData() {
return new Object[][] {{"hello", "test", null, null}, {"bye", "test", null, null}};
}