@Test
public void testParseContainerRequests() {

  Configuration conf = new Configuration();
  conf.addResource("tony-default.xml");
  conf.setInt("tony.worker.instances", 3);
  conf.setInt("tony.evaluator.instances", 1);
  conf.setInt("tony.worker.gpus", 1);
  conf.setInt("tony.evaluator.vcores", 2);
  conf.setInt("tony.chief.gpus", 1);
  conf.setInt("tony.db.instances", 1);
  conf.setInt("tony.dbwriter.instances", 1);
  conf.setStrings("tony.application.prepare-stage", "dbwriter, db");
  conf.setStrings("tony.application.untracked.jobtypes", "db");
  Map<String, JobContainerRequest> requests = Utils.parseContainerRequests(conf);
  assertEquals(requests.get("worker").getNumInstances(), 3);
  assertEquals(requests.get("evaluator").getNumInstances(), 1);
  assertEquals(requests.get("worker").getGPU(), 1);
  assertEquals(requests.get("evaluator").getVCores(), 2);
  // Check default value.
  assertEquals(requests.get("worker").getMemory(), 2048);
  // Check job does not exist if no instances are configured.
  assertFalse(requests.containsKey("chief"));
  assertEquals(requests.get("worker").getDependsOn(), new ArrayList<>(Arrays.asList("dbwriter")));
  assertEquals(requests.get("evaluator").getDependsOn(), new ArrayList<>(Arrays.asList("dbwriter")));
  assertEquals(requests.get("db").getDependsOn(), new ArrayList<>());
  assertEquals(requests.get("dbwriter").getDependsOn(), new ArrayList<>());
}