ConsulBundle implements ConfiguredBundle<C>, ConsulConfiguration<C> { @Override public void run(C configuration, Environment environment) throws Exception { final ConsulFactory consulConfig = getConsulFactory(configuration); if (!consulConfig.isEnabled()) { LOGGER.warn("Consul bundle disabled."); } else { runEnabled(consulConfig, environment); } } ConsulBundle(final String name);  ConsulBundle(final String name, final boolean strict);  ConsulBundle(
      final String name, final boolean strict, final boolean substitutionInVariables); @Override void initialize(Bootstrap<?> bootstrap); @Override void run(C configuration, Environment environment); @VisibleForTesting String getConsulAgentHost(); @VisibleForTesting int getConsulAgentPort(); @VisibleForTesting Optional<String> getConsulAclToken();  }
@Test public void testMissingServiceName() throws Exception { factory.setSeviceName(null); bundle.run(config, environment); assertThat(factory.getServiceName()).isEqualTo("test"); }
@Test public void testPopulatedServiceName() throws Exception { factory.setSeviceName("test-service-name"); bundle.run(config, environment); assertThat(factory.getServiceName()).isEqualTo("test-service-name"); }
@Test public void testAclToken() throws Exception { String token = "acl-token"; factory.setAclToken(token); bundle.run(config, environment); assertThat(factory.getAclToken().get()).isEqualTo(token); }