mirror of
https://github.com/spring-projects/spring-data-commons.git
synced 2026-05-04 05:20:24 +01:00
Add Java 17 verification to CI pipeline.
Avoid usage of encapsulated tests as dummies. Add dependency override for ASM dependencies. Replace Java 16 with Java 17 in CI pipeline. Closes #2423
This commit is contained in:
Vendored
+3
-3
@@ -3,7 +3,7 @@ pipeline {
|
||||
|
||||
triggers {
|
||||
pollSCM 'H/10 * * * *'
|
||||
upstream(upstreamProjects: "spring-data-build/", threshold: hudson.model.Result.SUCCESS)
|
||||
upstream(upstreamProjects: "spring-data-build/main", threshold: hudson.model.Result.SUCCESS)
|
||||
}
|
||||
|
||||
options {
|
||||
@@ -64,7 +64,7 @@ pipeline {
|
||||
}
|
||||
}
|
||||
|
||||
stage("test: baseline (jdk16)") {
|
||||
stage("test: baseline (jdk17)") {
|
||||
agent {
|
||||
label 'data'
|
||||
}
|
||||
@@ -75,7 +75,7 @@ pipeline {
|
||||
steps {
|
||||
script {
|
||||
docker.withRegistry('', 'hub.docker.com-springbuildmaster') {
|
||||
docker.image('adoptopenjdk/openjdk16:latest').inside('-v $HOME:/tmp/jenkins-home') {
|
||||
docker.image('openjdk:17-bullseye').inside('-v $HOME:/tmp/jenkins-home') {
|
||||
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -s settings.xml -Pjava11 clean dependency:list verify -Dsort -U -B'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -231,6 +231,13 @@
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.xbean</groupId>
|
||||
<artifactId>xbean-asm9-shaded</artifactId>
|
||||
<version>${webbeans.xbean}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.hateoas</groupId>
|
||||
<artifactId>spring-hateoas</artifactId>
|
||||
@@ -247,7 +254,7 @@
|
||||
<dependency>
|
||||
<groupId>com.sun.xml.bind</groupId>
|
||||
<artifactId>jaxb-impl</artifactId>
|
||||
<version>2.2.3U1</version>
|
||||
<version>2.3.5</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
@@ -18,11 +18,13 @@ package org.springframework.data;
|
||||
import static de.schauderhaft.degraph.check.JCheck.*;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
* @author Jens Schauder
|
||||
*/
|
||||
@Disabled("Requires newer version of ASM 5.1")
|
||||
public class DependencyTests {
|
||||
|
||||
@Test
|
||||
|
||||
@@ -19,9 +19,6 @@ import static org.assertj.core.api.Assertions.*;
|
||||
import static org.mockito.ArgumentMatchers.*;
|
||||
import static org.mockito.Mockito.*;
|
||||
|
||||
import java.text.DateFormat;
|
||||
import java.text.Format;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
@@ -33,6 +30,7 @@ import org.jmolecules.ddd.types.Association;
|
||||
import org.jmolecules.ddd.types.Identifier;
|
||||
import org.joda.time.DateTime;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.aop.framework.ProxyFactory;
|
||||
import org.springframework.core.convert.converter.Converter;
|
||||
import org.springframework.core.convert.converter.ConverterFactory;
|
||||
@@ -48,6 +46,7 @@ import org.springframework.data.convert.Jsr310Converters.LocalDateTimeToDateConv
|
||||
import org.springframework.data.convert.ThreeTenBackPortConverters.LocalDateTimeToJavaTimeInstantConverter;
|
||||
import org.springframework.data.geo.Point;
|
||||
import org.springframework.data.mapping.model.SimpleTypeHolder;
|
||||
|
||||
import org.threeten.bp.LocalDateTime;
|
||||
|
||||
/**
|
||||
@@ -163,8 +162,8 @@ class CustomConversionsUnitTests {
|
||||
void shouldSelectPropertCustomReadTargetForCglibProxiedType() {
|
||||
|
||||
CustomConversions conversions = new CustomConversions(StoreConversions.NONE,
|
||||
Arrays.asList(CustomObjectToStringConverter.INSTANCE));
|
||||
assertThat(conversions.hasCustomReadTarget(createProxyTypeFor(Object.class), String.class)).isTrue();
|
||||
Arrays.asList(CustomTypeToStringConverter.INSTANCE));
|
||||
assertThat(conversions.hasCustomReadTarget(createProxyTypeFor(CustomType.class), String.class)).isTrue();
|
||||
}
|
||||
|
||||
@Test // DATAMONGO-1131, DATACMNS-1035
|
||||
@@ -316,7 +315,7 @@ class CustomConversionsUnitTests {
|
||||
INSTANCE;
|
||||
|
||||
public Format convert(String source) {
|
||||
return DateFormat.getInstance();
|
||||
return new DateFormat();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -367,12 +366,13 @@ class CustomConversionsUnitTests {
|
||||
}
|
||||
}
|
||||
|
||||
enum CustomObjectToStringConverter implements Converter<Object, String> {
|
||||
@ReadingConverter
|
||||
enum CustomTypeToStringConverter implements Converter<CustomType, String> {
|
||||
|
||||
INSTANCE;
|
||||
|
||||
@Override
|
||||
public String convert(Object source) {
|
||||
public String convert(CustomType source) {
|
||||
return source != null ? source.toString() : null;
|
||||
}
|
||||
|
||||
@@ -414,7 +414,7 @@ class CustomConversionsUnitTests {
|
||||
}
|
||||
|
||||
try {
|
||||
return targetType.newInstance();
|
||||
return targetType.getDeclaredConstructor().newInstance();
|
||||
} catch (Exception e) {
|
||||
throw new IllegalArgumentException(e.getMessage(), e);
|
||||
}
|
||||
@@ -423,4 +423,11 @@ class CustomConversionsUnitTests {
|
||||
}
|
||||
|
||||
static class CustomType {}
|
||||
|
||||
static class Format {}
|
||||
|
||||
static class DateFormat extends Format {}
|
||||
|
||||
static class SimpleDateFormat extends DateFormat {}
|
||||
|
||||
}
|
||||
|
||||
+2
-2
@@ -296,13 +296,13 @@ class AbstractMappingContextUnitTests {
|
||||
}
|
||||
|
||||
@Test // GH-2390
|
||||
void detectsEntityTypeEveneIfSimpleTypeHolderConsidersCollectionsSimple() {
|
||||
void detectsEntityTypeEvenIfSimpleTypeHolderConsidersCollectionsSimple() {
|
||||
|
||||
context.setSimpleTypeHolder(new SimpleTypeHolder(Collections.emptySet(), true) {
|
||||
|
||||
@Override
|
||||
public boolean isSimpleType(Class<?> type) {
|
||||
return type.getName().startsWith("java.util.");
|
||||
return type == String.class || type.getName().startsWith("java.util.");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
+6
-2
@@ -24,7 +24,6 @@ import lombok.With;
|
||||
import java.sql.Timestamp;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import java.util.function.Function;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -130,7 +129,7 @@ public class PersistentPropertyAccessorTests {
|
||||
void kotlinCopyMethodShouldNotSetUnsettableProperty(
|
||||
Function<Object, PersistentPropertyAccessor<?>> propertyAccessorFunction) {
|
||||
|
||||
SingleSettableProperty bean = new SingleSettableProperty(UUID.randomUUID());
|
||||
SingleSettableProperty bean = new SingleSettableProperty(1.1);
|
||||
PersistentPropertyAccessor accessor = propertyAccessorFunction.apply(bean);
|
||||
SamplePersistentProperty property = getProperty(bean, "version");
|
||||
|
||||
@@ -224,4 +223,9 @@ public class PersistentPropertyAccessorTests {
|
||||
String immutable;
|
||||
}
|
||||
|
||||
static class UnsettableVersion {
|
||||
|
||||
private final int version = (int) Math.random();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -17,7 +17,6 @@ package org.springframework.data.mapping.model
|
||||
|
||||
import org.springframework.data.annotation.Id
|
||||
import java.time.LocalDateTime
|
||||
import java.util.*
|
||||
|
||||
/**
|
||||
* @author Mark Paluch
|
||||
@@ -30,7 +29,7 @@ data class ExtendedDataClassKt(val id: Long, val name: String) {
|
||||
}
|
||||
}
|
||||
|
||||
data class SingleSettableProperty constructor(val id: UUID = UUID.randomUUID()) {
|
||||
data class SingleSettableProperty constructor(val id: Double = Math.random()) {
|
||||
val version: Int? = null
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user