}
} finally {
sink.close();
}
CsvReader reader = new CsvReader(new InputStreamReader(new FileInputStream(file), "UTF-8"));
try {
Map<YaessJobId, List<String>> results = new HashMap<YaessJobId, List<String>>();
assertThat("skip header", reader.next(), is(true));
while (reader.next()) {
List<String> record = reader.get();
YaessJobId id = new YaessJobId();
id.setBatchId(record.get(0));
id.setFlowId(record.get(1));
id.setExecutionId(record.get(2));
id.setPhase(record.get(3));
id.setServiceId(record.get(4));
id.setJobId(record.get(5));
id.setTrackingId(record.get(6));
assertThat(results.get(id), is(nullValue()));
results.put(id, new ArrayList<String>(record.subList(7, record.size())));
}
return results;
} finally {
reader.close();
}
} catch (Exception e) {
throw new AssertionError(e);
}
}