XlsWriter implements TransformerWriter { @Override public void write(DataSetRow row) throws IOException { if (!row.values().isEmpty() && row.getRowMetadata().getColumns().isEmpty()) { throw new IllegalStateException( " If a dataset row has some values it should at least have columns just before writing the result of a non json transformation."); } String[] rowValues = row.order().toArray(DataSetRow.SKIP_TDP_ID); if (writtenMetadata == null) { rowsBuffer.appendRow(rowValues); } else { internalWriteRow(writtenMetadata, rowValues); } } XlsWriter(final OutputStream output);  XlsWriter(final OutputStream output, Map<String, String> parameters); @Override void write(DataSetRow row); @Override void write(RowMetadata metadata); @Override void close();  }
@Test(expected = IllegalStateException.class) public void should_only_write_values_in_columns_order_TDP_3188() throws Exception { final Map<String, String> values = new HashMap<>(); values.put("key", "value"); DataSetRow row = new DataSetRow(new RowMetadata(), values); writer.write(row); }