From 372d9266787f9633241e09a34f7224edd51d2ec9 Mon Sep 17 00:00:00 2001 From: Artem Bilan Date: Mon, 5 Feb 2024 12:51:45 -0500 Subject: [PATCH] Upgrade some dev dependencies * Fix JPA test for the latest Hibernate --- build.gradle | 29 +++++++++---------- .../jpa/core/HibernateJpaOperationsTests.java | 3 +- .../integration/jpa/dsl/JpaTests.java | 3 +- .../JpaOutboundChannelAdapterTests.java | 6 ++-- ...boundChannelAdapterTransactionalTests.java | 4 +-- 5 files changed, 20 insertions(+), 25 deletions(-) diff --git a/build.gradle b/build.gradle index ee1596ff83..c554e80855 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ buildscript { - ext.kotlinVersion = '1.9.10' + ext.kotlinVersion = '1.9.22' ext.isCI = System.getenv('GITHUB_ACTION') repositories { gradlePluginPortal() @@ -19,7 +19,7 @@ plugins { id 'io.spring.nohttp' version '0.0.11' apply false id 'org.ajoberstar.grgit' version '5.2.1' id 'io.spring.dependency-management' version '1.1.4' - id 'org.jetbrains.dokka' version "$kotlinVersion" + id 'org.jetbrains.dokka' version '1.9.10' id 'org.antora' version '1.0.0' id 'io.spring.antora.generate-antora-yml' version '0.0.1' id 'com.github.spotbugs' version '6.0.7' @@ -48,7 +48,7 @@ ext { files() .from { files(grgit.status().unstaged.modified) - .filter { f -> f.name.endsWith('.java') || f.name.endsWith('.kt') } + .filter { f -> f.name.endsWith('.java') || f.name.endsWith('.kt') || f.name.endsWith('.groovy') } } modifiedFiles.finalizeValueOnRead() @@ -72,7 +72,7 @@ ext { groovyVersion = '4.0.16' hamcrestVersion = '2.2' hazelcastVersion = '5.3.6' - hibernateVersion = '6.4.1.Final' + hibernateVersion = '6.4.4.Final' hsqldbVersion = '2.7.2' h2Version = '2.2.224' jacksonVersion = '2.15.3' @@ -88,7 +88,7 @@ ext { jythonVersion = '2.7.3' kotlinCoroutinesVersion = '1.7.3' kryoVersion = '5.5.0' - lettuceVersion = '6.3.0.RELEASE' + lettuceVersion = '6.3.1.RELEASE' log4jVersion = '2.21.1' mailVersion = '2.0.2' micrometerTracingVersion = '1.2.3' @@ -114,9 +114,9 @@ ext { springRetryVersion = '2.0.5' springSecurityVersion = '6.2.1' springVersion = '6.1.4' - springWsVersion = '4.0.9' - testcontainersVersion = '1.19.3' - tomcatVersion = '10.1.17' + springWsVersion = '4.0.10' + testcontainersVersion = '1.19.4' + tomcatVersion = '10.1.18' xmlUnitVersion = '2.9.1' xstreamVersion = '1.4.20' ztZipVersion = '1.16' @@ -307,7 +307,7 @@ configure(javaProjects) { subproject -> def beginningYear = matcher[0][1] if (now != beginningYear && now != matcher[0][2]) { def years = "$beginningYear-$now" - def sourceCode = file.text + def sourceCode = file.getText('UTF-8') sourceCode = sourceCode.replaceFirst(/20\d\d(-20\d\d)?/, years) file.text = sourceCode println "Copyright updated for file: $file" @@ -322,11 +322,6 @@ configure(javaProjects) { subproject -> compileKotlin.dependsOn updateCopyrights - test { - maxHeapSize = '2g' - jvmArgs '-XX:+HeapDumpOnOutOfMemoryError' - } - tasks.register('testAll', Test) { dependsOn['check'] } gradle.taskGraph.whenReady { graph -> @@ -335,7 +330,7 @@ configure(javaProjects) { subproject -> } } - tasks.withType(Test).all { + tasks.withType(Test).configureEach { // suppress all console output during testing unless running `gradle -i` logging.captureStandardOutput(LogLevel.INFO) @@ -347,6 +342,8 @@ configure(javaProjects) { subproject -> useJUnitPlatform() + reports.junitXml.required = false + enableAssertions = false } @@ -542,7 +539,7 @@ project('spring-integration-core') { classpath.from(sourceSets['main'].runtimeClasspath) externalDocumentationLink { url.set(new URL("https://docs.spring.io/spring-integration/docs/$version/api/")) - packageListUrl.set(file("$buildDir/docs/javadoc/element-list").toURI().toURL()) + packageListUrl.set(file('build/docs/javadoc/element-list').toURI().toURL()) } externalDocumentationLink { url.set(new URL('https://projectreactor.io/docs/core/release/api/')) diff --git a/spring-integration-jpa/src/test/java/org/springframework/integration/jpa/core/HibernateJpaOperationsTests.java b/spring-integration-jpa/src/test/java/org/springframework/integration/jpa/core/HibernateJpaOperationsTests.java index 46e4a9477c..78436dd4eb 100644 --- a/spring-integration-jpa/src/test/java/org/springframework/integration/jpa/core/HibernateJpaOperationsTests.java +++ b/spring-integration-jpa/src/test/java/org/springframework/integration/jpa/core/HibernateJpaOperationsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-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. @@ -207,7 +207,6 @@ public class HibernateJpaOperationsTests { entityManager.flush(); assertThat(savedStudent).isNotNull(); assertThat(savedStudent.getRollNumber()).isNotNull(); - assertThat(student.getRollNumber()).isEqualTo(savedStudent.getRollNumber()); assertThat(student != savedStudent).isTrue(); } diff --git a/spring-integration-jpa/src/test/java/org/springframework/integration/jpa/dsl/JpaTests.java b/spring-integration-jpa/src/test/java/org/springframework/integration/jpa/dsl/JpaTests.java index 8dc50ddd71..dfff5b0167 100644 --- a/spring-integration-jpa/src/test/java/org/springframework/integration/jpa/dsl/JpaTests.java +++ b/spring-integration-jpa/src/test/java/org/springframework/integration/jpa/dsl/JpaTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2023 the original author or authors. + * Copyright 2016-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. @@ -166,7 +166,6 @@ public class JpaTests { StudentDomain mergedStudent = (StudentDomain) receive.getPayload(); assertThat(mergedStudent.getFirstName()).isEqualTo(student.getFirstName()); assertThat(mergedStudent.getRollNumber()).isNotNull(); - assertThat(student.getRollNumber()).isEqualTo(mergedStudent.getRollNumber()); } @Test diff --git a/spring-integration-jpa/src/test/java/org/springframework/integration/jpa/outbound/JpaOutboundChannelAdapterTests.java b/spring-integration-jpa/src/test/java/org/springframework/integration/jpa/outbound/JpaOutboundChannelAdapterTests.java index a6a28bc964..d597160fe7 100644 --- a/spring-integration-jpa/src/test/java/org/springframework/integration/jpa/outbound/JpaOutboundChannelAdapterTests.java +++ b/spring-integration-jpa/src/test/java/org/springframework/integration/jpa/outbound/JpaOutboundChannelAdapterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-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. @@ -102,7 +102,7 @@ public class JpaOutboundChannelAdapterTests { List results2 = this.jdbcTemplate.queryForList("Select * from Student"); assertThat(results2).hasSize(4); - assertThat(testStudent.getRollNumber()).isNotNull(); + assertThat(results2.get(0)).extracting("rollNumber").isNotNull(); } @Test @@ -134,7 +134,7 @@ public class JpaOutboundChannelAdapterTests { List results2 = this.jdbcTemplate.queryForList("Select * from Student"); assertThat(results2).hasSize(4); - assertThat(testStudent.getRollNumber()).isNotNull(); + assertThat(results2.get(0)).extracting("rollNumber").isNotNull(); } @Test diff --git a/spring-integration-jpa/src/test/java/org/springframework/integration/jpa/outbound/JpaOutboundChannelAdapterTransactionalTests.java b/spring-integration-jpa/src/test/java/org/springframework/integration/jpa/outbound/JpaOutboundChannelAdapterTransactionalTests.java index 32a5f81812..f618ccf217 100644 --- a/spring-integration-jpa/src/test/java/org/springframework/integration/jpa/outbound/JpaOutboundChannelAdapterTransactionalTests.java +++ b/spring-integration-jpa/src/test/java/org/springframework/integration/jpa/outbound/JpaOutboundChannelAdapterTransactionalTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-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. @@ -72,7 +72,7 @@ public class JpaOutboundChannelAdapterTransactionalTests { .queryForList("Select * from Student"); assertThat(results2).hasSize(4); - assertThat(testStudent.getRollNumber()).isNotNull(); + assertThat(results2.get(0)).extracting("rollNumber").isNotNull(); } }