Search in sources :

Example 1 with DefaultApplicationFactory

use of de.codecentric.boot.admin.client.registration.DefaultApplicationFactory in project spring-boot-admin by codecentric.

the class DefaultApplicationFactoryTest method test_mgmtPortPath.

@Test
public void test_mgmtPortPath() {
    management.setContextPath("/admin");
    DefaultApplicationFactory factory = new DefaultApplicationFactory(client, management, server, "/alive");
    publishApplicationReadyEvent(factory, 8080, 8081);
    Application app = factory.createApplication();
    assertThat(app.getManagementUrl(), is("http://" + getHostname() + ":8081/admin"));
    assertThat(app.getHealthUrl(), is("http://" + getHostname() + ":8081/admin/alive"));
    assertThat(app.getServiceUrl(), is("http://" + getHostname() + ":8080"));
}
Also used : SpringApplication(org.springframework.boot.SpringApplication) Application(de.codecentric.boot.admin.client.registration.Application) DefaultApplicationFactory(de.codecentric.boot.admin.client.registration.DefaultApplicationFactory) Test(org.junit.Test)

Aggregations

Application (de.codecentric.boot.admin.client.registration.Application)1 DefaultApplicationFactory (de.codecentric.boot.admin.client.registration.DefaultApplicationFactory)1 Test (org.junit.Test)1 SpringApplication (org.springframework.boot.SpringApplication)1