import spring boot BOM

This commit is contained in:
Carsten Otto
2022-11-01 10:26:10 +01:00
parent 03df47c7e5
commit a07fbbe5b4
3 changed files with 22 additions and 8 deletions

View File

@@ -9,7 +9,6 @@ plugins {
id 'lnd-manageJ.pmd'
id 'lnd-manageJ.jacoco'
id 'org.springframework.boot'
id 'io.spring.dependency-management'
id 'java-test-fixtures'
id 'lnd-manageJ.spotbugs'
id 'lnd-manageJ.versions'
@@ -33,6 +32,7 @@ tasks.withType(JavaCompile).configureEach {
dependencies {
implementation platform('de.cotto.lndmanagej:platform')
testFixturesImplementation platform('de.cotto.lndmanagej:platform')
implementation 'org.springframework.boot:spring-boot-starter'
implementation 'org.apache.commons:commons-lang3'
implementation 'com.google.code.findbugs:jsr305'

View File

@@ -2,8 +2,10 @@ package de.cotto.lndmanagej.caching;
import com.github.benmanes.caffeine.cache.LoadingCache;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Timeout;
import java.time.Duration;
import java.util.concurrent.TimeUnit;
import static org.assertj.core.api.Assertions.assertThat;
@@ -59,14 +61,23 @@ class CacheBuilderTest {
}
@Test
@Timeout(value = 900, unit = TimeUnit.MILLISECONDS)
void withRefresh_returns_old_value() throws InterruptedException {
LoadingCache<Object, Long> cache = new CacheBuilder()
.withRefresh(Duration.ofMillis(1))
.build(System::nanoTime);
.build(() -> {
try {
Thread.sleep(1_000);
} catch (InterruptedException e) {
// ignore
}
return System.nanoTime();
});
cache.put("", 0L);
Long first = cache.get("");
Thread.sleep(10);
Long second = cache.get("");
assertThat(first).isEqualTo(second);
assertThat(first).isEqualTo(second).isEqualTo(0L);
}
@Test
@@ -117,4 +128,4 @@ class CacheBuilderTest {
Long second = cache.get("");
assertThat(first).isEqualTo(second);
}
}
}

View File

@@ -9,7 +9,10 @@ javaPlatform {
}
dependencies {
def springBootVersion = '2.7.5'
def grpcVersion = '1.45.1'
api platform('org.springframework.cloud:spring-cloud-dependencies:2021.0.4')
api platform('org.springframework.boot:spring-boot-dependencies:' + springBootVersion)
constraints {
api 'com.adarshr:gradle-test-logger-plugin:3.2.0'
@@ -27,9 +30,9 @@ dependencies {
api 'info.solidsoft.gradle.pitest:gradle-pitest-plugin:1.9.0'
api 'io.dropwizard.metrics:metrics-core:4.2.10'
api 'io.github.resilience4j:resilience4j-spring-boot2:1.7.1'
api 'io.grpc:grpc-netty:1.45.1'
api 'io.grpc:grpc-protobuf:1.45.1'
api 'io.grpc:grpc-stub:1.45.1'
api 'io.grpc:grpc-netty:' + grpcVersion
api 'io.grpc:grpc-protobuf:' + grpcVersion
api 'io.grpc:grpc-stub:' + grpcVersion
api 'javax.annotation:javax.annotation-api:1.3.2'
api 'net.ltgt.gradle:gradle-errorprone-plugin:3.0.1'
api 'net.ltgt.gradle:gradle-nullaway-plugin:1.4.0'
@@ -38,7 +41,7 @@ dependencies {
api 'org.awaitility:awaitility:4.2.0'
api 'org.eclipse.collections:eclipse-collections:11.0.0'
api 'org.ini4j:ini4j:0.5.4'
api 'org.springframework.boot:spring-boot-gradle-plugin:2.7.5'
api 'org.springframework.boot:spring-boot-gradle-plugin:' + springBootVersion
api 'org.webjars:bootstrap:5.2.0'
api 'org.webjars:webjars-locator:0.45'
api 'uk.org.lidalia:slf4j-test:1.2.0'