@Test
public void testResolveCompsCircularDependency() {

  Service service = createExampleApplication();
  List<String> dependencies = new ArrayList<String>();
  List<String> dependencies2 = new ArrayList<String>();
  dependencies.add("compb");
  dependencies2.add("compa");
  Component compa = createComponent("compa");
  compa.setDependencies(dependencies);
  Component compb = createComponent("compb");
  compa.setDependencies(dependencies2);
  service.addComponent(compa);
  service.addComponent(compb);
  List<String> order = ServiceApiUtil.resolveCompsDependency(service);
  List<String> expected = new ArrayList<String>();
  expected.add("compa");
  expected.add("compb");
  for (int i = 0; i < expected.size(); i++) {
    Assert.assertEquals("Components are not equal.", expected.get(i),
        order.get(i));
  }
}