JobDetailFormatter { protected static BigDecimal estimateCost(int numInstances, BigDecimal costPerHour, long time) { BigDecimal cost = BigDecimal.ZERO; BigDecimal hours = new BigDecimal(Math.max(1, Math.ceil(time / HOURS))); cost = cost.add(costPerHour.multiply(new BigDecimal(numInstances)).multiply(hours)); cost = cost.add(cost.multiply(new BigDecimal(1.5D))); return cost; }  static String createJobDetails(JobValidator validator, Workload workload, JobInstance proposedJobInstance); static String createJobDetails(JobValidator validator, String scriptName);  }
@Test public void estimateCost() { BigDecimal estimateCost = JobDetailFormatter.estimateCost(2, BigDecimal.valueOf(1.5D), 600000); assertEquals(estimateCost.doubleValue(), 7.50D); }
@Test public void testEstimateCost_1() throws Exception { int numInstances = 1; BigDecimal costPerHour = new BigDecimal(1.0); long time = 1L; BigDecimal result = JobDetailFormatter.estimateCost(numInstances, costPerHour, time); assertNotNull(result); }