@Test
public void testResolve_MetricsFile() throws Exception {

  File metricsFile = new File("testMetricsFile");
  // specified in child only
  ServiceInfo info = new ServiceInfo();
  ServiceInfo parentInfo = new ServiceInfo();
  ServiceModule child = createServiceModule(info);
  ServiceModule parent = createServiceModule(parentInfo);
  // set in the module constructor from a value obtained from service directory which is mocked
  assertEquals(metricsFile, child.getModuleInfo().getMetricsFile());
  parent.getModuleInfo().setMetricsFile(null);
  resolveService(child, parent);
  assertEquals(metricsFile, child.getModuleInfo().getMetricsFile());
  // specified in parent only
  child = createServiceModule(info);
  parent = createServiceModule(parentInfo);
  parent.getModuleInfo().setMetricsFile(metricsFile);
  child.getModuleInfo().setMetricsFile(null);
  resolveService(child, parent);
  assertEquals(metricsFile, child.getModuleInfo().getMetricsFile());
  // specified in both
  child = createServiceModule(info);
  parent = createServiceModule(parentInfo);
  parent.getModuleInfo().setMetricsFile(new File("someOtherDir"));
  child.getModuleInfo().setMetricsFile(metricsFile);
  resolveService(child, parent);
  assertEquals(metricsFile, child.getModuleInfo().getMetricsFile());
}