Formatting
This commit is contained in:
@@ -59,7 +59,8 @@ public class GatewayMetricsAutoConfiguration {
|
||||
}
|
||||
|
||||
@Bean
|
||||
public PropertiesTagsProvider propertiesTagsProvider(GatewayMetricsProperties gatewayMetricsProperties) {
|
||||
public PropertiesTagsProvider propertiesTagsProvider(
|
||||
GatewayMetricsProperties gatewayMetricsProperties) {
|
||||
return new PropertiesTagsProvider(gatewayMetricsProperties.getTags());
|
||||
}
|
||||
|
||||
|
||||
@@ -41,4 +41,5 @@ public class PropertiesTagsProvider implements GatewayTagsProvider {
|
||||
public Tags apply(ServerWebExchange serverWebExchange) {
|
||||
return propertiesTags;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -37,15 +37,18 @@ public class PropertiesTagsProviderTests {
|
||||
@Test
|
||||
public void test() {
|
||||
contextRunner
|
||||
.withConfiguration(AutoConfigurations.of(GatewayMetricsAutoConfiguration.class))
|
||||
.withPropertyValues(
|
||||
"spring.cloud.gateway.metrics.tags.foo1=bar1",
|
||||
.withConfiguration(
|
||||
AutoConfigurations.of(GatewayMetricsAutoConfiguration.class))
|
||||
.withPropertyValues("spring.cloud.gateway.metrics.tags.foo1=bar1",
|
||||
"spring.cloud.gateway.metrics.tags.foo2=bar2")
|
||||
.run(context -> {
|
||||
PropertiesTagsProvider provider = context.getBean(PropertiesTagsProvider.class);
|
||||
Tags tags = provider.apply(MockServerWebExchange.from(MockServerHttpRequest.get("").build()));
|
||||
PropertiesTagsProvider provider = context
|
||||
.getBean(PropertiesTagsProvider.class);
|
||||
Tags tags = provider.apply(MockServerWebExchange
|
||||
.from(MockServerHttpRequest.get("").build()));
|
||||
assertThat(tags).isEqualTo(Tags.of("foo1", "bar1", "foo2", "bar2"));
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user