@Test public void canGenerateSingleUserYearJson() throws Exception { List<UsageStatistic> usageStatistics = jsonExtractor.getSingleUserUsageInYear("cvop", "2017"); reportGenerator = new ReportGenerator(); assertThat(reportGenerator.generateJsonUserSingleJob(usageStatistics), equalTo("{\n" + " \"memoryUsagePrice\": \"3.55\",\n" + " \"totalFileReadingMb\": \"75,653,192\",\n" + " \"cpuUsagePrice\": \"20.67\",\n" + " \"diskUsageprice\": \"830.3\",\n" + " \"totalPrice\": \"854.52\",\n" + " \"totalFileWritingMb\": \"260,776\",\n" + " \"totalMemoryUsedMbs\": \"58,687,343,062\",\n" + " \"totalCpuTimeSpent\": \"12852:34:07\",\n" + " \"jobsProcessed\": \"2762\",\n" + " \"user\": \"cvop\",\n" + " \"totalVcoresUsed\": \"56,276,906\",\n" + " \"totalMap\": \"0\"\n" + "}")); }
String generateJsonUserSingleJob(List<UsageStatistic> usageStatistics) { Gson gson = new GsonBuilder().setPrettyPrinting().create(); return gson.toJson(usageStatistics); }
ReportGenerator { String generateJsonUserSingleJob(List<UsageStatistic> usageStatistics) { Gson gson = new GsonBuilder().setPrettyPrinting().create(); return gson.toJson(usageStatistics); } }
ReportGenerator { String generateJsonUserSingleJob(List<UsageStatistic> usageStatistics) { Gson gson = new GsonBuilder().setPrettyPrinting().create(); return gson.toJson(usageStatistics); }  }
ReportGenerator { String generateJsonUserSingleJob(List<UsageStatistic> usageStatistics) { Gson gson = new GsonBuilder().setPrettyPrinting().create(); return gson.toJson(usageStatistics); }   }
ReportGenerator { String generateJsonUserSingleJob(List<UsageStatistic> usageStatistics) { Gson gson = new GsonBuilder().setPrettyPrinting().create(); return gson.toJson(usageStatistics); }    }