use of io.confluent.ksql.util.TabularRow in project ksql by confluentinc.
the class AssertExecutor method throwAssertionError.
private static void throwAssertionError(final String message, final DataSource dataSource, final KsqlGenericRecord expected, final List<KsqlGenericRecord> actual) {
final List<Column> columns = ImmutableList.<Column>builder().add(Column.of(ColumnName.of("."), SqlTypes.STRING, Namespace.KEY, 0)).add(Column.of(SystemColumns.ROWTIME_NAME, SqlTypes.BIGINT, Namespace.KEY, 0)).addAll(dataSource.getSchema().columns()).build();
final TabularRow headerRow = TabularRow.createHeader(80, columns, false, 0);
final StringBuilder actualRows = new StringBuilder();
actual.forEach(a -> actualRows.append(fromGenericRow(false, dataSource, a)).append('\n'));
throw new AssertionError(String.format("%s%n%s%n%s%n%s", message, headerRow, fromGenericRow(true, dataSource, expected), actualRows.toString()));
}
Aggregations