### Question:
CommunityDiscoverableURIs { public static DiscoverableURIs communityDiscoverableURIs( Config config, ConnectorPortRegister portRegister ) { return new DiscoverableURIs.Builder() .add( "data", config.get( ServerSettings.rest_api_path ).getPath() + "/", NORMAL ) .add( "management", config.get( ServerSettings.management_api_path ).getPath() + "/", NORMAL ) .addBoltConnectorFromConfig( "bolt", "bolt", config, ServerSettings.bolt_discoverable_address, portRegister ) .build(); }  static DiscoverableURIs communityDiscoverableURIs( Config config, ConnectorPortRegister portRegister );  }### Answer:
@Test public void shouldAdvertiseDataAndManagementURIs() throws Exception { DiscoverableURIs uris = communityDiscoverableURIs( Config.defaults(), null ); assertEquals( map( "data", "/db/data/", "management", "/db/manage/" ), toMap(uris) ); }
@Test public void shouldAdvertiseBoltIfExplicitlyConfigured() throws Exception { DiscoverableURIs uris = communityDiscoverableURIs( Config.defaults( ServerSettings.bolt_discoverable_address, "bolt: assertEquals( "bolt: }
@Test public void shouldLookupBoltPortInRegisterIfConfiguredTo0() throws Exception { BoltConnector bolt = new BoltConnector( "honestJakesBoltConnector" ); ConnectorPortRegister register = new ConnectorPortRegister(); register.register( bolt.key(), new InetSocketAddress( 1337 ) ); DiscoverableURIs uris = communityDiscoverableURIs( Config.builder() .withSetting( bolt.advertised_address, "apple.com:0" ) .withSetting( bolt.enabled, "true" ) .withSetting( bolt.type, BoltConnector.ConnectorType.BOLT.name() ) .build(), register ); assertEquals( "bolt: }
@Test public void shouldOmitBoltIfNoConnectorConfigured() throws Exception { DiscoverableURIs uris = communityDiscoverableURIs( Config.builder().build(), null ); assertFalse( toMap( uris ).containsKey( "bolt" ) ); }