NetworkCfg implements ConfigurationEntry { public void setHost(final String host) { this.host = host; }  @Override void init(final BrokerCfg brokerCfg, final String brokerBase); void applyDefaults(); String getHost(); void setHost(final String host); String getAdvertisedHost(); void setAdvertisedHost(final String advertisedHost); int getPortOffset(); void setPortOffset(final int portOffset); long getMaxMessageSizeInBytes(); DataSize getMaxMessageSize(); void setMaxMessageSize(final DataSize maxMessageSize); CommandApiCfg getCommandApi(); SocketBindingCfg getMonitoringApi(); void setMonitoringApi(final MonitoringApiCfg monitoringApi); SocketBindingCfg getInternalApi(); void setInternalApi(final InternalApiCfg internalApi); @Override String toString(); static final String DEFAULT_HOST; static final int DEFAULT_COMMAND_API_PORT; static final int DEFAULT_INTERNAL_API_PORT; static final int DEFAULT_MONITORING_API_PORT; static final DataSize DEFAULT_MAX_MESSAGE_SIZE; }
@Test public void shouldNotFailOnLongHostName() { final var port = 1000; final var hostName = RandomString.make(139); final var networkCfg = new NetworkCfg(); networkCfg.setPort(port); networkCfg.setHost(hostName); final var socketAddress = networkCfg.toSocketAddress(); assertThat(socketAddress).isEqualTo(new InetSocketAddress(hostName, port)); }