Merge pull request #15823 from dreis2211

* pr/15823:
  Polish
pull/15888/head
Stephane Nicoll 6 years ago
commit 9244f82593

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

Loading…
Cancel
Save