assertThat(row2.get("col2"), equalTo("row22"));
}
@Test
public void shouldConvertMultilineTableToParameters() throws ParseException, IntrospectionException {
ParameterConverter converter = new ExamplesTableParametersConverter();
Type type = SomeSteps.methodFor("aMethodWithExamplesTableParameters").getGenericParameterTypes()[0];
assertThat(converter.accept(type), is(true));
assertThat(converter.accept(WrongType.class), is(false));
assertThat(converter.accept(mock(Type.class)), is(false));
String value = "|col1|col2|\n|row11|row12|\n|row21|row22|\n";
@SuppressWarnings("unchecked")
List<MyParameters> parameters = (List<MyParameters>) converter.convertValue(value, type);
assertThat(parameters.size(), equalTo(2));
MyParameters row1 = parameters.get(0);
assertThat(row1.col1, equalTo("row11"));
assertThat(row1.col2, equalTo("row12"));
MyParameters row2 = parameters.get(1);