Start building against Micrometer 1.14.0 snapshots
See gh-42137
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2024 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.
|
||||
@@ -51,7 +51,9 @@ class CacheMetricsAutoConfigurationTests {
|
||||
|
||||
@Test
|
||||
void autoConfiguredCacheManagerIsInstrumented() {
|
||||
this.contextRunner.withPropertyValues("spring.cache.type=caffeine", "spring.cache.cache-names=cache1,cache2")
|
||||
this.contextRunner
|
||||
.withPropertyValues("spring.cache.type=caffeine", "spring.cache.cache-names=cache1,cache2",
|
||||
"spring.cache.caffeine.spec=recordStats")
|
||||
.run((context) -> {
|
||||
MeterRegistry registry = context.getBean(MeterRegistry.class);
|
||||
registry.get("cache.gets").tags("name", "cache1").tags("cache.manager", "cacheManager").meter();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2024 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.
|
||||
@@ -41,7 +41,9 @@ class CacheMetricsRegistrarTests {
|
||||
void bindToSupportedCache() {
|
||||
CacheMetricsRegistrar registrar = new CacheMetricsRegistrar(this.meterRegistry,
|
||||
Collections.singleton(new CaffeineCacheMeterBinderProvider()));
|
||||
assertThat(registrar.bindCacheToRegistry(new CaffeineCache("test", Caffeine.newBuilder().build()))).isTrue();
|
||||
assertThat(
|
||||
registrar.bindCacheToRegistry(new CaffeineCache("test", Caffeine.newBuilder().recordStats().build())))
|
||||
.isTrue();
|
||||
assertThat(this.meterRegistry.get("cache.gets").tags("name", "test").meter()).isNotNull();
|
||||
}
|
||||
|
||||
@@ -49,8 +51,8 @@ class CacheMetricsRegistrarTests {
|
||||
void bindToSupportedCacheWrappedInTransactionProxy() {
|
||||
CacheMetricsRegistrar registrar = new CacheMetricsRegistrar(this.meterRegistry,
|
||||
Collections.singleton(new CaffeineCacheMeterBinderProvider()));
|
||||
assertThat(registrar.bindCacheToRegistry(
|
||||
new TransactionAwareCacheDecorator(new CaffeineCache("test", Caffeine.newBuilder().build()))))
|
||||
assertThat(registrar.bindCacheToRegistry(new TransactionAwareCacheDecorator(
|
||||
new CaffeineCache("test", Caffeine.newBuilder().recordStats().build()))))
|
||||
.isTrue();
|
||||
assertThat(this.meterRegistry.get("cache.gets").tags("name", "test").meter()).isNotNull();
|
||||
}
|
||||
@@ -58,7 +60,9 @@ class CacheMetricsRegistrarTests {
|
||||
@Test
|
||||
void bindToUnsupportedCache() {
|
||||
CacheMetricsRegistrar registrar = new CacheMetricsRegistrar(this.meterRegistry, Collections.emptyList());
|
||||
assertThat(registrar.bindCacheToRegistry(new CaffeineCache("test", Caffeine.newBuilder().build()))).isFalse();
|
||||
assertThat(
|
||||
registrar.bindCacheToRegistry(new CaffeineCache("test", Caffeine.newBuilder().recordStats().build())))
|
||||
.isFalse();
|
||||
assertThat(this.meterRegistry.find("cache.gets").tags("name", "test").meter()).isNull();
|
||||
}
|
||||
|
||||
|
||||
@@ -1301,7 +1301,7 @@ bom {
|
||||
]
|
||||
}
|
||||
}
|
||||
library("Micrometer", "1.14.0-M2") {
|
||||
library("Micrometer", "1.14.0-SNAPSHOT") {
|
||||
considerSnapshots()
|
||||
group("io.micrometer") {
|
||||
modules = [
|
||||
|
||||
Reference in New Issue
Block a user