use of de.codecentric.boot.admin.server.domain.values.Registration in project spring-boot-admin by codecentric.
the class RegistrationDeserializerTest method test_sanitize_metadata.
@Test
public void test_sanitize_metadata() throws JsonProcessingException {
Registration app = Registration.create("test", "http://health").metadata("PASSWORD", "qwertz123").metadata("user", "humptydumpty").build();
String json = objectMapper.writeValueAsString(app);
assertThat(json).doesNotContain("qwertz123");
assertThat(json).contains("humptydumpty");
}
use of de.codecentric.boot.admin.server.domain.values.Registration in project spring-boot-admin by codecentric.
the class RegistrationDeserializerTest method test_1_4_json_format.
@Test
public void test_1_4_json_format() throws Exception {
String json = new JSONObject().put("name", "test").put("managementUrl", "http://test").put("healthUrl", "http://health").put("serviceUrl", "http://service").put("statusInfo", new JSONObject().put("status", "UNKNOWN")).toString();
Registration value = objectMapper.readValue(json, Registration.class);
assertThat(value.getName()).isEqualTo("test");
assertThat(value.getManagementUrl()).isEqualTo("http://test");
assertThat(value.getHealthUrl()).isEqualTo("http://health");
assertThat(value.getServiceUrl()).isEqualTo("http://service");
}
use of de.codecentric.boot.admin.server.domain.values.Registration in project spring-boot-admin by codecentric.
the class CloudFoundryHttpHeaderProviderTest method test_cloud_foundry_header.
@Test
public void test_cloud_foundry_header() {
Registration registration = Registration.create("foo", "http://health").metadata("applicationId", "549e64cf-a478-423d-9d6d-02d803a028a8").metadata("instanceId", "0").build();
Instance instance = Instance.create(InstanceId.of("id")).register(registration);
assertThat(headersProvider.getHeaders(instance).get("X-CF-APP-INSTANCE")).containsOnly("549e64cf-a478-423d-9d6d-02d803a028a8:0");
}
Aggregations