ConsulConfigurationProvider extends AbstractConfigurationProvider { @Override protected ConfigWatcherRegister initConfigReader() throws ModuleStartException { LOGGER.info("consul settings: {}", settings); if (Strings.isNullOrEmpty(settings.getHostAndPorts())) { throw new ModuleStartException("Consul hostAndPorts cannot be null or empty"); } return new ConsulConfigurationWatcherRegister(settings); } ConsulConfigurationProvider(); @Override String name(); @Override ModuleConfig createConfigBeanIfAbsent();  }
@Test(expected = ModuleStartException.class) public void shouldThrowWhenSettingsInvalid() throws ModuleStartException { ConsulConfigurationProvider provider = new ConsulConfigurationProvider(); provider.initConfigReader(); }