ReportGenerator { String generateTextSingleJob(UsageStatistic usageStatistic) { StringBuilder stringBuilder = new StringBuilder(); List<String> report = getSingleJobReportContents(usageStatistic); for (String line : report) { stringBuilder.append(line).append("\n"); } return stringBuilder.toString(); }    }
@Test public void canGenerateTextSingleJob() throws Exception { UsageStatistic usageStatistic = jsonExtractor.getSingleStatistic("job_1481485063251_20052", "2017-01-10"); reportGenerator = new ReportGenerator(); assertThat(reportGenerator.generateTextSingleJob(usageStatistic), equalTo("Usage statistic for job 'job_1481485063251_20052'\n" + "\n" + "Project : fire\n" + "Start time : 12.01.2017 17:03:40\n" + "Finish time : 12.01.2017 17:33:06\n" + "Total time : 00:29:26\nStatus : SUCCEEDED\n" + "Total file writing (MB) : 89\n" + "Total file reading (MB) : 262\n" + "Total CPU time spent : 00:29:58\n" + "Total Memory used (MB s) : 7,500,170\n" + "Total vCores used (vCore s) : 1,762\n")); }