@Test
public void testManagedServiceFactory() throws Exception {

  // Make sure we can register a capture agent with specific scheduler roles
  String pid = UUID.randomUUID().toString();
  Dictionary<String, String> properties = new Hashtable<>();
  properties.put("id", "agent1");
  properties.put("organization", DefaultOrganization.DEFAULT_ORGANIZATION_ID);
  properties.put("url", "http://agent1:8080/");
  properties.put("schedulerRoles", DefaultOrganization.DEFAULT_ORGANIZATION_ADMIN + ", SOME_OTHER_ROLE");
  service.updated(pid, properties);
  // If any of the three values are missing, we should throw
  properties.remove("id");
  try {
    service.updated(pid, properties);
    fail();
  } catch (ConfigurationException e) {
    // expected
  }
}