@Test public void convert_secure() { InstanceInfo instanceInfo = mock(InstanceInfo.class); when(instanceInfo.getSecureHealthCheckUrl()).thenReturn(""); when(instanceInfo.getHealthCheckUrl()).thenReturn("http: EurekaServiceInstance service = mock(EurekaServiceInstance.class); when(service.getInstanceInfo()).thenReturn(instanceInfo); when(service.getUri()).thenReturn(URI.create("http: when(service.getServiceId()).thenReturn("test"); when(service.getMetadata()).thenReturn(singletonMap("management.context-path", "/mgmt")); Registration registration = new EurekaServiceInstanceConverter().convert(service); assertThat(registration.getName()).isEqualTo("test"); assertThat(registration.getServiceUrl()).isEqualTo("http: assertThat(registration.getManagementUrl()).isEqualTo("http: assertThat(registration.getHealthUrl()).isEqualTo("http: }
@Override protected URI getHealthUrl(ServiceInstance instance) { Assert.isInstanceOf(EurekaServiceInstance.class, instance, "serviceInstance must be of type EurekaServiceInstance"); InstanceInfo instanceInfo = ((EurekaServiceInstance) instance).getInstanceInfo(); String healthUrl = instanceInfo.getSecureHealthCheckUrl(); if (StringUtils.isEmpty(healthUrl)) { healthUrl = instanceInfo.getHealthCheckUrl(); } return URI.create(healthUrl); }
EurekaServiceInstanceConverter extends DefaultServiceInstanceConverter { @Override protected URI getHealthUrl(ServiceInstance instance) { Assert.isInstanceOf(EurekaServiceInstance.class, instance, "serviceInstance must be of type EurekaServiceInstance"); InstanceInfo instanceInfo = ((EurekaServiceInstance) instance).getInstanceInfo(); String healthUrl = instanceInfo.getSecureHealthCheckUrl(); if (StringUtils.isEmpty(healthUrl)) { healthUrl = instanceInfo.getHealthCheckUrl(); } return URI.create(healthUrl); } }
EurekaServiceInstanceConverter extends DefaultServiceInstanceConverter { @Override protected URI getHealthUrl(ServiceInstance instance) { Assert.isInstanceOf(EurekaServiceInstance.class, instance, "serviceInstance must be of type EurekaServiceInstance"); InstanceInfo instanceInfo = ((EurekaServiceInstance) instance).getInstanceInfo(); String healthUrl = instanceInfo.getSecureHealthCheckUrl(); if (StringUtils.isEmpty(healthUrl)) { healthUrl = instanceInfo.getHealthCheckUrl(); } return URI.create(healthUrl); }  }
EurekaServiceInstanceConverter extends DefaultServiceInstanceConverter { @Override protected URI getHealthUrl(ServiceInstance instance) { Assert.isInstanceOf(EurekaServiceInstance.class, instance, "serviceInstance must be of type EurekaServiceInstance"); InstanceInfo instanceInfo = ((EurekaServiceInstance) instance).getInstanceInfo(); String healthUrl = instanceInfo.getSecureHealthCheckUrl(); if (StringUtils.isEmpty(healthUrl)) { healthUrl = instanceInfo.getHealthCheckUrl(); } return URI.create(healthUrl); }   }
EurekaServiceInstanceConverter extends DefaultServiceInstanceConverter { @Override protected URI getHealthUrl(ServiceInstance instance) { Assert.isInstanceOf(EurekaServiceInstance.class, instance, "serviceInstance must be of type EurekaServiceInstance"); InstanceInfo instanceInfo = ((EurekaServiceInstance) instance).getInstanceInfo(); String healthUrl = instanceInfo.getSecureHealthCheckUrl(); if (StringUtils.isEmpty(healthUrl)) { healthUrl = instanceInfo.getHealthCheckUrl(); } return URI.create(healthUrl); }    }