Search in sources :

Example 6 with Application

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

the class DefaultApplicationFactoryTest method test_ssl.

@Test
public void test_ssl() {
    server.setSsl(new Ssl());
    server.getSsl().setEnabled(true);
    publishApplicationReadyEvent(factory, 8080, null);
    Application app = factory.createApplication();
    assertThat(app.getManagementUrl(), is("https://" + getHostname() + ":8080"));
    assertThat(app.getHealthUrl(), is("https://" + getHostname() + ":8080/health"));
    assertThat(app.getServiceUrl(), is("https://" + getHostname() + ":8080"));
}
Also used : Ssl(org.springframework.boot.context.embedded.Ssl) SpringApplication(org.springframework.boot.SpringApplication) Application(de.codecentric.boot.admin.client.registration.Application) Test(org.junit.Test)

Example 7 with Application

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

the class DefaultApplicationFactoryTest method test_allcustom.

@Test
public void test_allcustom() {
    client.setHealthUrl("http://health");
    client.setManagementUrl("http://management");
    client.setServiceUrl("http://service");
    Application app = factory.createApplication();
    assertThat(app.getServiceUrl(), is("http://service"));
    assertThat(app.getManagementUrl(), is("http://management"));
    assertThat(app.getHealthUrl(), is("http://health"));
}
Also used : SpringApplication(org.springframework.boot.SpringApplication) Application(de.codecentric.boot.admin.client.registration.Application) Test(org.junit.Test)

Example 8 with Application

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

the class DefaultApplicationFactoryTest method test_preferIpAddress.

@Test
public void test_preferIpAddress() throws UnknownHostException {
    client.setPreferIp(true);
    server.setAddress(InetAddress.getByName("127.0.0.1"));
    management.setAddress(InetAddress.getByName("127.0.0.2"));
    publishApplicationReadyEvent(factory, 8080, 8081);
    Application app = factory.createApplication();
    assertThat(app.getManagementUrl(), is("http://127.0.0.2:8081"));
    assertThat(app.getHealthUrl(), is("http://127.0.0.2:8081/health"));
    assertThat(app.getServiceUrl(), is("http://127.0.0.1:8080"));
}
Also used : SpringApplication(org.springframework.boot.SpringApplication) Application(de.codecentric.boot.admin.client.registration.Application) Test(org.junit.Test)

Example 9 with Application

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

the class DefaultApplicationFactoryTest method test_contextPath.

@Test
public void test_contextPath() {
    server.setContextPath("app");
    publishApplicationReadyEvent(factory, 80, null);
    Application app = factory.createApplication();
    assertThat(app.getManagementUrl(), is("http://" + getHostname() + ":80/app"));
    assertThat(app.getHealthUrl(), is("http://" + getHostname() + ":80/app/health"));
    assertThat(app.getServiceUrl(), is("http://" + getHostname() + ":80/app"));
}
Also used : SpringApplication(org.springframework.boot.SpringApplication) Application(de.codecentric.boot.admin.client.registration.Application) Test(org.junit.Test)

Example 10 with Application

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

the class DefaultApplicationFactoryTest method test_contextPath_mgmtPath.

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

Aggregations

Application (de.codecentric.boot.admin.client.registration.Application)14 Test (org.junit.Test)14 SpringApplication (org.springframework.boot.SpringApplication)12 Ssl (org.springframework.boot.context.embedded.Ssl)2 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 DocumentContext (com.jayway.jsonpath.DocumentContext)1 DefaultApplicationFactory (de.codecentric.boot.admin.client.registration.DefaultApplicationFactory)1