Search in sources :

Example 1 with ApplicationFactory

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

the class ApplicationRegistratorTest method setup.

@Before
public void setup() {
    restTemplate = mock(RestTemplate.class);
    adminProps = new AdminProperties();
    adminProps.setUrl(new String[] { "http://sba:8080", "http://sba2:8080" });
    ApplicationFactory factory = mock(ApplicationFactory.class);
    when(factory.createApplication()).thenReturn(Application.create("AppName").withManagementUrl("http://localhost:8080/mgmt").withHealthUrl("http://localhost:8080/health").withServiceUrl("http://localhost:8080").build());
    registrator = new ApplicationRegistrator(restTemplate, adminProps, factory);
    headers = new HttpHeaders();
    headers.setContentType(MediaType.APPLICATION_JSON);
    headers.setAccept(Collections.singletonList(MediaType.APPLICATION_JSON));
}
Also used : AdminProperties(de.codecentric.boot.admin.client.config.AdminProperties) HttpHeaders(org.springframework.http.HttpHeaders) ApplicationRegistrator(de.codecentric.boot.admin.client.registration.ApplicationRegistrator) RestTemplate(org.springframework.web.client.RestTemplate) ApplicationFactory(de.codecentric.boot.admin.client.registration.ApplicationFactory) Before(org.junit.Before)

Aggregations

AdminProperties (de.codecentric.boot.admin.client.config.AdminProperties)1 ApplicationFactory (de.codecentric.boot.admin.client.registration.ApplicationFactory)1 ApplicationRegistrator (de.codecentric.boot.admin.client.registration.ApplicationRegistrator)1 Before (org.junit.Before)1 HttpHeaders (org.springframework.http.HttpHeaders)1 RestTemplate (org.springframework.web.client.RestTemplate)1