ControlPointConfig extends SimpleComponent<ControlPointConfig> implements OptionalConfigurationComponent<ControlPointConfig>,
    PasswordsConfig<ControlPointConfig> { @Override public void basicValidate(final String configSection) throws ConfigException { if (BooleanUtils.isTrue(enabled)) { if (server == null) { throw new ConfigException(SECTION, "ControlPoint is enabled but server details are missing"); } server.basicValidate(SECTION); } }  @Override void basicValidate(final String configSection); @Override ControlPointConfig withoutPasswords(); @Override ControlPointConfig withEncryptedPasswords(final TextEncryptor encryptor); @Override ControlPointConfig withDecryptedPasswords(final TextEncryptor encryptor);  }
@Test public void testBasicValidate_disabled() throws ConfigException { new ControlPointConfig(false, null).basicValidate("cp"); }
@Test public void testBasicValidate_enabled() throws ConfigException { new ControlPointConfig(true, ControlPointServerConfigTest.validConfig).basicValidate("cp"); }
@Test(expected = ConfigException.class) public void testBasicValidate_missingServer() throws ConfigException { new ControlPointConfig(true, null).basicValidate("cp"); }
@Test(expected = ConfigException.class) public void testBasicValidate_invalidServer() throws ConfigException { final ControlPointServerConfig invalidServer = ControlPointServerConfigTest.validConfig.toBuilder().protocol(null).build(); new ControlPointConfig(true, invalidServer).basicValidate("cp"); }