use of de.codecentric.boot.admin.client.registration.Application in project spring-boot-admin by codecentric.
the class ApplicationTest method test_equals_hashCode.
@Test
public void test_equals_hashCode() {
Application a1 = Application.create("foo").withHealthUrl("healthUrl").withManagementUrl("mgmt").withServiceUrl("svc").build();
Application a2 = Application.create("foo").withHealthUrl("healthUrl").withManagementUrl("mgmt").withServiceUrl("svc").build();
assertThat(a1, is(a2));
assertThat(a1.hashCode(), is(a2.hashCode()));
Application a3 = Application.create("foo").withHealthUrl("healthUrl2").withManagementUrl("mgmt").withServiceUrl("svc").build();
assertThat(a1, not(is(a3)));
assertThat(a2, not(is(a3)));
}
use of de.codecentric.boot.admin.client.registration.Application in project spring-boot-admin by codecentric.
the class DefaultApplicationFactoryTest method test_servletPath.
@Test
public void test_servletPath() {
server.setServletPath("app");
server.setContextPath("srv");
publishApplicationReadyEvent(factory, 80, null);
Application app = factory.createApplication();
assertThat(app.getManagementUrl(), is("http://" + getHostname() + ":80/srv/app"));
assertThat(app.getHealthUrl(), is("http://" + getHostname() + ":80/srv/app/health"));
assertThat(app.getServiceUrl(), is("http://" + getHostname() + ":80/srv"));
}
use of de.codecentric.boot.admin.client.registration.Application in project spring-boot-admin by codecentric.
the class DefaultApplicationFactoryTest method test_default.
@Test
public void test_default() {
publishApplicationReadyEvent(factory, 8080, null);
Application app = factory.createApplication();
assertThat(app.getManagementUrl(), is("http://" + getHostname() + ":8080"));
assertThat(app.getHealthUrl(), is("http://" + getHostname() + ":8080/health"));
assertThat(app.getServiceUrl(), is("http://" + getHostname() + ":8080"));
}
use of de.codecentric.boot.admin.client.registration.Application in project spring-boot-admin by codecentric.
the class DefaultApplicationFactoryTest method test_preferIpAddress_managementaddress_missing.
@Test
public void test_preferIpAddress_managementaddress_missing() {
client.setPreferIp(true);
publishApplicationReadyEvent(factory, 8080, 8081);
Application app = factory.createApplication();
assertTrue(app.getManagementUrl().matches("http://\\d{0,3}\\.\\d{0,3}\\.\\d{0,3}\\.\\d{0,3}:8081"));
}
Aggregations