.intValue()); builder.enablePort(PortType.UNSECURE, !"false".equals(reader.getAttribute(ATTR_ENABLED))); } else if (ELEM_SECURE_PORT.equals(nodeName)) { .intValue()); builder.enablePort(PortType.SECURE, "true".equals(reader.getAttribute(ATTR_ENABLED))); } else if (ELEM_COUNTRY_ID.equals(nodeName)) {
case ENABLED: if (jsonToken == JsonToken.FIELD_NAME) jp.nextToken(); builder.enablePort(PortType.UNSECURE, jp.getValueAsBoolean()); break; default: case ENABLED: if (jsonToken == JsonToken.FIELD_NAME) jp.nextToken(); builder.enablePort(PortType.SECURE, jp.getValueAsBoolean()); break; default:
@Test public void testHealthCheckSetContainsValidUrlEntries() throws Exception { Builder builder = newBuilder() .setAppName("test") .setNamespace("eureka.") .setHostName("localhost") .setPort(80) .setSecurePort(443) .enablePort(PortType.SECURE, true); // No health check URLs InstanceInfo noHealtcheckInstanceInfo = builder.build(); assertThat(noHealtcheckInstanceInfo.getHealthCheckUrls().size(), is(equalTo(0))); // Now when health check is defined InstanceInfo instanceInfo = builder .setHealthCheckUrls("/healthcheck", "http://${eureka.hostname}/healthcheck", "https://${eureka.hostname}/healthcheck") .build(); assertThat(instanceInfo.getHealthCheckUrls().size(), is(equalTo(2))); }
case ENABLED: if (jsonToken == JsonToken.FIELD_NAME) jp.nextToken(); builder.enablePort(PortType.UNSECURE, jp.getValueAsBoolean()); break; default: case ENABLED: if (jsonToken == JsonToken.FIELD_NAME) jp.nextToken(); builder.enablePort(PortType.SECURE, jp.getValueAsBoolean()); break; default:
.setPort(8080) .setSecurePort(8081) .enablePort(PortType.SECURE, true) .setHealthCheckUrls("/healthcheck", unsecureURL + "/healthcheck", secureURL + "/healthcheck") .setHomePageUrl("/homepage", unsecureURL + "/homepage") .setLastDirtyTimestamp(System.currentTimeMillis() - 100) .setIsCoordinatingDiscoveryServer(true) .enablePort(PortType.UNSECURE, true); if (includeAsg) { builder.setASGName(appName + "ASG");
.setHostName(defaultAddress) .setPort(config.getNonSecurePort()) .enablePort(PortType.UNSECURE, config.isNonSecurePortEnabled()) .setSecurePort(config.getSecurePort()) .enablePort(PortType.SECURE, config.getSecurePortEnabled()) .setVIPAddress(config.getVirtualHostName()) .setSecureVIPAddress(config.getSecureVirtualHostName())
.intValue()); builder.enablePort(PortType.UNSECURE, !"false".equals(reader.getAttribute(ATTR_ENABLED))); } else if (ELEM_SECURE_PORT.equals(nodeName)) { .intValue()); builder.enablePort(PortType.SECURE, "true".equals(reader.getAttribute(ATTR_ENABLED))); } else if (ELEM_COUNTRY_ID.equals(nodeName)) {
.setIPAddr(config.getIpAddress()).setHostName(config.getHostName(false)) .setPort(config.getNonSecurePort()) .enablePort(InstanceInfo.PortType.UNSECURE, config.isNonSecurePortEnabled()) .setSecurePort(config.getSecurePort()) .enablePort(InstanceInfo.PortType.SECURE, config.getSecurePortEnabled()) .setVIPAddress(config.getVirtualHostName()) .setSecureVIPAddress(config.getSecureVirtualHostName())
.setPort(8080) .setSecurePort(8081) .enablePort(PortType.SECURE, true) .setHealthCheckUrls("/healthcheck", unsecureURL + "/healthcheck", secureURL + "/healthcheck") .setHomePageUrl("/homepage", unsecureURL + "/homepage") .setLastDirtyTimestamp(System.currentTimeMillis() - 100) .setIsCoordinatingDiscoveryServer(true) .enablePort(PortType.UNSECURE, true); if (includeAsg) { builder.setASGName(appName + "ASG");
.setHostName(defaultAddress) .setPort(config.getNonSecurePort()) .enablePort(PortType.UNSECURE, config.isNonSecurePortEnabled()) .setSecurePort(config.getSecurePort()) .enablePort(PortType.SECURE, config.getSecurePortEnabled()) .setVIPAddress(config.getVirtualHostName()) .setSecureVIPAddress(config.getSecureVirtualHostName())