@Test
public void testFlumeConfigAddsErrorOnInvalidConfig() {

  HashMap<String, String> properties = new HashMap<>();
  properties.put("agent.channels", "c1");
  properties.put("agent.channel.c1", "cc1");
  FlumeConfiguration config = new FlumeConfiguration(properties);
  List<FlumeConfigurationError> configurationErrors = config.getConfigurationErrors();
  assertEquals(4, configurationErrors.size());
  assertError(configurationErrors.get(0), INVALID_PROPERTY, "agent", "channel.c1", ERROR);
  assertError(configurationErrors.get(1), CONFIG_ERROR, "agent", "c1", ERROR);
  assertError(configurationErrors.get(2), PROPERTY_VALUE_NULL, "agent", "channels", ERROR);
  assertError(configurationErrors.get(3), AGENT_CONFIGURATION_INVALID, "agent", "", ERROR);
}