|
|
|
@ -1,5 +1,5 @@
|
|
|
|
|
/*
|
|
|
|
|
* Copyright 2012-2018 the original author or authors.
|
|
|
|
|
* Copyright 2012-2019 the original author or authors.
|
|
|
|
|
*
|
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
@ -18,7 +18,6 @@ package org.springframework.boot.actuate.metrics.web.client;
|
|
|
|
|
|
|
|
|
|
import java.net.URI;
|
|
|
|
|
import java.net.URISyntaxException;
|
|
|
|
|
import java.util.stream.StreamSupport;
|
|
|
|
|
|
|
|
|
|
import io.micrometer.core.instrument.MeterRegistry;
|
|
|
|
|
import io.micrometer.core.instrument.MockClock;
|
|
|
|
@ -70,10 +69,9 @@ public class MetricsRestTemplateCustomizerTests {
|
|
|
|
|
.andRespond(MockRestResponseCreators.withSuccess("OK",
|
|
|
|
|
MediaType.APPLICATION_JSON));
|
|
|
|
|
String result = this.restTemplate.getForObject("/test/{id}", String.class, 123);
|
|
|
|
|
assertThat(this.registry.find("http.client.requests").meters())
|
|
|
|
|
.anySatisfy((m) -> assertThat(
|
|
|
|
|
StreamSupport.stream(m.getId().getTags().spliterator(), false)
|
|
|
|
|
.map(Tag::getKey)).doesNotContain("bucket"));
|
|
|
|
|
assertThat(this.registry.find("http.client.requests").meters()).anySatisfy(
|
|
|
|
|
(m) -> assertThat(m.getId().getTags().stream().map(Tag::getKey))
|
|
|
|
|
.doesNotContain("bucket"));
|
|
|
|
|
assertThat(this.registry.get("http.client.requests")
|
|
|
|
|
.tags("method", "GET", "uri", "/test/{id}", "status", "200").timer()
|
|
|
|
|
.count()).isEqualTo(1);
|
|
|
|
|