use of de.codecentric.boot.admin.server.domain.entities.Instance in project spring-boot-admin by codecentric.
the class BasicAuthHttpHeaderProviderTest method test_auth_header_no_separator.
@Test
public void test_auth_header_no_separator() {
Registration registration = Registration.create("foo", "http://health").metadata("username", "test").metadata("userpassword", "drowssap").build();
Instance instance = Instance.create(InstanceId.of("id")).register(registration);
assertThat(this.headersProvider.getHeaders(instance).get(HttpHeaders.AUTHORIZATION)).containsOnly("Basic dGVzdDpkcm93c3NhcA==");
}
use of de.codecentric.boot.admin.server.domain.entities.Instance in project spring-boot-admin by codecentric.
the class BasicAuthHttpHeaderProviderTest method test_auth_instance_enabled_use_default_creds.
@Test
public void test_auth_instance_enabled_use_default_creds() {
Registration registration = Registration.create("foo", "http://health").name("xyz-server").build();
Instance instance = Instance.create(InstanceId.of("id")).register(registration);
assertThat(this.headersProviderEnableInstanceAuth.getHeaders(instance).get(HttpHeaders.AUTHORIZATION)).containsOnly("Basic Y2xpZW50OmNsaWVudA==");
}
use of de.codecentric.boot.admin.server.domain.entities.Instance in project spring-boot-admin by codecentric.
the class BasicAuthHttpHeaderProviderTest method test_auth_instance_enabled_use_metadata_over_props.
@Test
public void test_auth_instance_enabled_use_metadata_over_props() {
Registration registration = Registration.create("foo", "http://health").metadata("username", "test").metadata("userpassword", "drowssap").name("xyz-server").build();
Instance instance = Instance.create(InstanceId.of("id")).register(registration);
assertThat(this.headersProviderEnableInstanceAuth.getHeaders(instance).get(HttpHeaders.AUTHORIZATION)).containsOnly("Basic dGVzdDpkcm93c3NhcA==");
}
use of de.codecentric.boot.admin.server.domain.entities.Instance in project spring-boot-admin by codecentric.
the class BasicAuthHttpHeaderProviderTest method test_auth_header.
@Test
public void test_auth_header() {
Registration registration = Registration.create("foo", "http://health").metadata("user.name", "test").metadata("user.password", "drowssap").build();
Instance instance = Instance.create(InstanceId.of("id")).register(registration);
assertThat(this.headersProvider.getHeaders(instance).get(HttpHeaders.AUTHORIZATION)).containsOnly("Basic dGVzdDpkcm93c3NhcA==");
}
use of de.codecentric.boot.admin.server.domain.entities.Instance in project spring-boot-admin by codecentric.
the class BasicAuthHttpHeaderProviderTest method test_auth_instance_enabled_use_service_specific_creds.
@Test
public void test_auth_instance_enabled_use_service_specific_creds() {
Registration registration = Registration.create("foo", "http://health").name("sb-admin-server").build();
Instance instance = Instance.create(InstanceId.of("id")).register(registration);
assertThat(this.headersProviderEnableInstanceAuth.getHeaders(instance).get(HttpHeaders.AUTHORIZATION)).containsOnly("Basic YWRtaW46YWRtaW4=");
}
Aggregations