use of de.codecentric.boot.admin.server.web.client.InstanceWebClient.ATTRIBUTE_INSTANCE in project spring-boot-admin by codecentric.
the class InstanceWebClientTest method should_add_instance_attribute.
@Test
public void should_add_instance_attribute() {
Instance instance = Instance.create(InstanceId.of("i"));
Mono<ClientResponse> response = InstanceWebClient.builder().filter((inst, req, next) -> {
assertThat(req.attribute(ATTRIBUTE_INSTANCE)).hasValue(instance);
assertThat(inst).isEqualTo(instance);
return Mono.just(ClientResponse.create(HttpStatus.OK).build());
}).build().instance(Mono.just(instance)).get().uri("http://test/health").exchangeToMono(Mono::just);
StepVerifier.create(response).assertNext((r) -> assertThat(r.statusCode()).isEqualTo(HttpStatus.OK)).verifyComplete();
}
Aggregations