### Question:
EnterpriseDiscoverableURIs { public static DiscoverableURIs enterpriseDiscoverableURIs( Config config, ConnectorPortRegister ports ) { DiscoverableURIs uris = communityDiscoverableURIs( config, ports ); if ( config.get( EnterpriseEditionSettings.mode ) == EnterpriseEditionSettings.Mode.CORE ) { return (new Builder( CommunityDiscoverableURIs.communityDiscoverableURIs( config, ports ) )).addBoltConnectorFromConfig( "bolt_routing", "bolt+routing", config, EnterpriseServerSettings.bolt_routing_discoverable_address, ports ).build(); } return uris; }  static DiscoverableURIs enterpriseDiscoverableURIs( Config config, ConnectorPortRegister ports );  }### Answer:
@Test public void shouldExposeBoltRoutingIfCore() throws Exception { BoltConnector bolt = new BoltConnector( "honestJakesBoltConnector" ); Config config = Config.builder() .withSetting( EnterpriseEditionSettings.mode, EnterpriseEditionSettings.Mode.CORE.name() ) .withSetting( bolt.enabled, "true" ) .withSetting( bolt.type, BoltConnector.ConnectorType.BOLT.name() ) .build(); Map<String,Object> asd = toMap( EnterpriseDiscoverableURIs.enterpriseDiscoverableURIs( config, new ConnectorPortRegister() ) ); assertThat(asd.get("bolt_routing"), equalTo( "bolt+routing: }
@Test public void shouldGrabPortFromRegisterIfSetTo0() throws Exception { BoltConnector bolt = new BoltConnector( "honestJakesBoltConnector" ); Config config = Config.builder() .withSetting( EnterpriseEditionSettings.mode, EnterpriseEditionSettings.Mode.CORE.name() ) .withSetting( bolt.enabled, "true" ) .withSetting( bolt.type, BoltConnector.ConnectorType.BOLT.name() ) .withSetting( bolt.listen_address, ":0" ) .build(); ConnectorPortRegister ports = new ConnectorPortRegister(); ports.register( bolt.key(), new InetSocketAddress( 1337 ) ); Map<String,Object> asd = toMap( EnterpriseDiscoverableURIs.enterpriseDiscoverableURIs( config, ports ) ); assertThat(asd.get("bolt_routing"), equalTo( "bolt+routing: }