use of de.codecentric.boot.admin.model.Application in project spring-boot-admin by codecentric.
the class DefaultServiceInstanceConverterTest method test_convert_with_metadata.
@Test
public void test_convert_with_metadata() {
ServiceInstance service = new DefaultServiceInstance("test", "localhost", 80, false);
Map<String, String> metadata = new HashMap<>();
metadata.put("health.path", "ping");
metadata.put("management.context-path", "mgmt");
metadata.put("management.port", "1234");
service.getMetadata().putAll(metadata);
Application application = new DefaultServiceInstanceConverter().convert(service);
assertThat(application.getId(), nullValue());
assertThat(application.getName(), is("test"));
assertThat(application.getServiceUrl(), is("http://localhost:80"));
assertThat(application.getManagementUrl(), is("http://localhost:1234/mgmt"));
assertThat(application.getHealthUrl(), is("http://localhost:1234/mgmt/ping"));
assertThat(application.getMetadata(), is(metadata));
}
Aggregations