Skip to content

Commit

Permalink
NOTICK: Update dependency versions for detekt, hibernate, jackson, ja…
Browse files Browse the repository at this point in the history
…valin and junit (#1746)

This updates the following dependency versions:

Detekt 1.20 -> 1.21
Hibernate 5.6.9.FINAL -> 5.6.10.FINAL
Jackson 2.13.2 -> 2.13.3
Javalin 4.6.3 -> 4.6.4
JUnit 5.8.2 -> 5.9.0
Notes:

- The detekt update has resulted in a lot of extra errors being flagged in the AMQP code. I re-baselined it but I still had to set some new suppressions. The rest of the codebase was unaffected.
- The detekt update also resulted in errors being reported in the detekt configuration. These have been addressed.
- The JUnit update ended up being more impactful than might be expected from a minor version bump, as a bugfix introduced in this version is actually a breaking change. Previously test lifecycle methods (e.g. a method marked as @beforeeach) were incorrectly allowed to be private. I've updated instances where this was causing a problem. See https://junit.org/junit5/docs/snapshot/release-notes/ for details.
- The JUnit update also appears to be more stringent when it comes to resolving engine and platform dependencies (this is also mentioned in the release notes). This seems to be an issue for the sandbox testing code, which can no longer resolve without some extra dependencies added.

* NOTICK: Update Jackson and detekt versions

* NOTICK: Update detekt config and AMQP baseline

* NOTICK: Update JUnit dependency

* NOTICK: Update integration tests with private test lifecycle methods

* NOTICK: Remove separate jackson databind versioning and sandbox testing build updates

* NOTICK: Minor flow logging improvement
  • Loading branch information
JamesHR3 authored Jul 28, 2022
1 parent 6b37979 commit fe74c6c
Show file tree
Hide file tree
Showing 37 changed files with 2,685 additions and 95 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ dependencies {
// Transitive dependency bump to eliminate critical violation in NexusIQ report - see nexus iq report.
// Constraints block can be removed when Avro is upgraded to the next version
constraints {
implementation("com.fasterxml.jackson.core:jackson-databind:$jacksonDatabindVersion") {
implementation("com.fasterxml.jackson.core:jackson-databind:$jacksonVersion") {
because 'sonatype-2021-4682'
}
}
Expand Down
2 changes: 1 addition & 1 deletion applications/examples/amqp-evolution-poc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ dependencies {
// Transitive dependency bump to eliminate critical violation in NexusIQ report - see nexus iq report.
// Constraints block can be removed when Avro is upgraded to the next version
constraints {
implementation("com.fasterxml.jackson.core:jackson-databind:$jacksonDatabindVersion") {
implementation("com.fasterxml.jackson.core:jackson-databind:$jacksonVersion") {
because 'sonatype-2021-4682'
}
}
Expand Down
2 changes: 1 addition & 1 deletion applications/workers/worker-common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ dependencies {
implementation "com.typesafe:config:$typeSafeConfigVersion"
implementation "info.picocli:picocli:$picocliVersion"
implementation "io.javalin:javalin-osgi:$javalinVersion"
implementation "com.fasterxml.jackson.core:jackson-databind:$jacksonDatabindVersion"
implementation "com.fasterxml.jackson.core:jackson-databind:$jacksonVersion"

runtimeOnly project(':libs:lifecycle:lifecycle-impl')
runtimeOnly "org.apache.commons:commons-lang3:$commonsLangVersion"
Expand Down
2 changes: 1 addition & 1 deletion components/chunking/chunk-db-write-impl/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ dependencies {
implementation project(":libs:utilities")
implementation project(':components:chunking:chunk-db-write')

implementation "com.fasterxml.jackson.core:jackson-databind:$jacksonDatabindVersion"
implementation "com.fasterxml.jackson.core:jackson-databind:$jacksonVersion"
implementation "com.fasterxml.jackson.module:jackson-module-kotlin:$jacksonVersion"

implementation project(":libs:lifecycle:lifecycle")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package net.corda.chunking.db.impl.tests
import net.corda.chunking.RequestId
import net.corda.chunking.db.impl.AllChunksReceived
import net.corda.chunking.db.impl.ChunkWriteToDbProcessor
import net.corda.chunking.db.impl.persistence.database.DatabaseChunkPersistence
import net.corda.chunking.db.impl.persistence.StatusPublisher
import net.corda.chunking.db.impl.persistence.database.DatabaseChunkPersistence
import net.corda.data.chunking.Chunk
import net.corda.messaging.api.records.Record
import net.corda.schema.Schemas
Expand Down Expand Up @@ -38,7 +38,7 @@ internal class ChunkWriteToDbProcessorTest {
private fun randomString() = UUID.randomUUID().toString()

@BeforeEach
private fun beforeEach() {
fun beforeEach() {
val checksum = SecureHash("SHA-256", ByteArray(16))
val validator = { _: RequestId -> checksum }
publisher = mock<StatusPublisher>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,12 @@ internal class DatabaseChunkPersistenceTest {
lateinit var fs: FileSystem

@BeforeEach
private fun beforeEach() {
fun beforeEach() {
fs = Jimfs.newFileSystem()
}

@AfterEach
private fun afterEach() {
fun afterEach() {
fs.close()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,12 @@ internal class DatabaseCpiPersistenceTest {
lateinit var fs: FileSystem

@BeforeEach
private fun beforeEach() {
fun beforeEach() {
fs = Jimfs.newFileSystem()
}

@AfterEach
private fun afterEach() {
fun afterEach() {
fs.close()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,12 @@ class RecreateBinaryTest {
lateinit var fs: FileSystem

@BeforeEach
private fun beforeEach() {
fun beforeEach() {
fs = Jimfs.newFileSystem()
}

@AfterEach
private fun afterEach() {
fun afterEach() {
fs.close()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@ class UpsertCpiTests {
lateinit var fs: FileSystem

@BeforeEach
private fun beforeEach() {
fun beforeEach() {
fs = Jimfs.newFileSystem()
}

@AfterEach
private fun afterEach() = fs.close()
fun afterEach() = fs.close()

private val cpiPersistence = DatabaseCpiPersistence(entityManagerFactory)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ internal class AssembleFromChunksTest {
lateinit var fs: FileSystem

@BeforeEach
private fun beforeEach() {
fun beforeEach() {
fs = Jimfs.newFileSystem()
}

@AfterEach
private fun afterEach() {
fun afterEach() {
fs.close()
}

Expand Down
2 changes: 1 addition & 1 deletion components/crypto/crypto-service-impl/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ dependencies {
implementation "net.corda.kotlin:kotlin-stdlib-jdk8-osgi"
implementation platform("net.corda:corda-api:$cordaApiVersion")

implementation "com.fasterxml.jackson.core:jackson-databind:$jacksonDatabindVersion"
implementation "com.fasterxml.jackson.core:jackson-databind:$jacksonVersion"
implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jacksonVersion"
implementation "com.fasterxml.jackson.module:jackson-module-kotlin:$jacksonVersion"
implementation "com.github.ben-manes.caffeine:caffeine:$caffeineVersion"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class DbAdminTest {

@Suppress("Unused")
@AfterAll
private fun cleanup() {
fun cleanup() {
dbConfig.close()
entityManagerFactory.close()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import net.corda.flow.fiber.FlowContinuation
import net.corda.flow.fiber.FlowFiberExecutionContext
import net.corda.flow.fiber.FlowFiberImpl
import net.corda.flow.fiber.FlowLogicAndArgs
import net.corda.flow.pipeline.exceptions.FlowFatalException
import org.osgi.service.component.annotations.Component
import org.osgi.service.component.annotations.Deactivate
import java.util.UUID
Expand All @@ -27,12 +28,16 @@ class FlowFiberFactoryImpl : FlowFiberFactory {
flowId: String,
logic: FlowLogicAndArgs
): FiberFuture {
val id = try {
UUID.fromString(flowId)
} catch (e: IllegalArgumentException) {
throw FlowFatalException("Expected the flow key to have a UUID id found '${flowId}' instead.", e)
}
try {
val id = UUID.fromString(flowId)
val flowFiber = FlowFiberImpl(id, logic, currentScheduler)
return FiberFuture(flowFiber, flowFiber.startFlow(flowFiberExecutionContext))
} catch (e: Throwable) {
throw IllegalArgumentException("Expected the flow key to have a UUID id found '${flowId}' instead.", e)
throw FlowFatalException("Unable to execute flow fiber: ${e.message}", e)
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
package net.corda.entityprocessor.impl.tests

import java.nio.ByteBuffer
import java.nio.file.Path
import java.time.Instant
import java.time.LocalDate
import java.time.ZoneOffset
import java.time.temporal.ChronoUnit
import java.util.Calendar
import java.util.UUID
import net.corda.cpiinfo.read.CpiInfoReadService
import net.corda.data.flow.event.FlowEvent
import net.corda.data.persistence.DeleteEntity
Expand Down Expand Up @@ -70,6 +62,14 @@ import org.osgi.test.common.annotation.InjectBundleContext
import org.osgi.test.common.annotation.InjectService
import org.osgi.test.junit5.context.BundleContextExtension
import org.osgi.test.junit5.service.ServiceExtension
import java.nio.ByteBuffer
import java.nio.file.Path
import java.time.Instant
import java.time.LocalDate
import java.time.ZoneOffset
import java.time.temporal.ChronoUnit
import java.util.Calendar
import java.util.UUID


/**
Expand Down Expand Up @@ -121,7 +121,7 @@ class PersistenceServiceInternalTests {
}

@BeforeEach
private fun beforeEach() {
fun beforeEach() {
ctx = createDbTestContext()
// Each test is likely to leave junk lying around in the tables before the next test.
// We can't trust deleting the tables because tests can run concurrently.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import net.corda.sandboxgroupcontext.SandboxGroupContext
import net.corda.sandboxgroupcontext.SandboxGroupType
import net.corda.sandboxgroupcontext.VirtualNodeContext
import net.corda.sandboxgroupcontext.putUniqueObject
import net.corda.sandboxgroupcontext.service.impl.SandboxGroupContextCache
import net.corda.sandboxgroupcontext.service.impl.CloseableSandboxGroupContext
import net.corda.sandboxgroupcontext.service.impl.SandboxGroupContextCache
import net.corda.sandboxgroupcontext.service.impl.SandboxGroupContextServiceImpl
import net.corda.v5.crypto.SecureHash
import net.corda.v5.serialization.SingletonSerializeAsToken
Expand Down Expand Up @@ -80,7 +80,7 @@ class SandboxGroupContextServiceImplTest {
private val cpkServiceImpl = CpkReadServiceFake(cpks)

@BeforeEach
private fun beforeEach() {
fun beforeEach() {
service = SandboxGroupContextServiceImpl(
Helpers.mockSandboxCreationService(listOf(cpks)),
cpkServiceImpl,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class SandboxGroupContextTest {
private lateinit var sandboxGroupContext: SandboxGroupContextImpl

@BeforeEach
private fun beforeEach() {
fun beforeEach() {
sandboxGroupContext = SandboxGroupContextImpl(virtualNodeContext, mock())
}

Expand Down
6 changes: 3 additions & 3 deletions detekt-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,11 @@ style:
ForbiddenComment:
active: true
excludes: "**/buildSrc/**"
values: 'TODO:,FIXME:,STOPSHIP:'
values: ['TODO:','FIXME:','STOPSHIP:']
MagicNumber:
active: false
excludes: "**/test/**,**/integration-test/**,**/integration-test-slow/**,**/*Test.kt,**/*Tests.kt,**/buildSrc/**"
ignoreNumbers: '-1,0,1,2'
ignoreNumbers: ['-1','0','1','2']
ignoreHashCodeFunction: true
ignorePropertyDeclaration: false
ignoreConstantDeclaration: true
Expand Down Expand Up @@ -209,6 +209,6 @@ style:
WildcardImport:
active: true
excludes: "**/buildSrc/**"
excludeImports: 'java.util.*,kotlinx.android.synthetic.*'
excludeImports: ['java.util.*','kotlinx.android.synthetic.*']
UnusedImports:
active: true
16 changes: 6 additions & 10 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ cordaRuntimeRevision=0
# Plugin dependency versions
bndVersion=6.3.1
cordaGradlePluginsVersion=6.0.0-BETA17
detektPluginVersion=1.20.+
detektPluginVersion=1.21.+
internalPublishVersion=1.+
internalDockerVersion=1.+
dependencyCheckVersion=0.42.+
Expand Down Expand Up @@ -48,13 +48,9 @@ felixSecurityVersion=2.8.3
# NOTE: Guava cannot easily be upgraded as it needs a Quasar change.
# Check with one of the group leads before changing.
guavaVersion=30.1.1-jre
hibernateVersion = 5.6.9.Final
hibernateVersion = 5.6.10.Final
hikariCpVersion=5.0.1

# jacksonDatabindVersion can be collapsed back into Jackson Version once 2.13.3 is out
jacksonDatabindVersion = 2.13.2.2
jacksonVersion = 2.13.2

jacksonVersion = 2.13.3
jaxbVersion = 2.3.1
jbossTransactionApiSpecVersion=1.1.1.Final
kafkaClientVersion=2.8.1_1
Expand Down Expand Up @@ -90,8 +86,8 @@ hamcrestVersion=2.1
# NOTE: 2.6.0 does not have OSGi exports
hsqldbVersion=2.5.2
jimfsVersion = 1.2
junit5Version=5.8.2
junitPlatformVersion=1.8.2
junit5Version=5.9.0
junitPlatformVersion=1.9.0
mockitoInlineVersion=4.6.1
mockitoKotlinVersion=4.0.0
mockitoVersion=4.6.1
Expand All @@ -100,7 +96,7 @@ postgresDriverVersion=42.4.0
slingVersion=3.3.0

# HTTP RPC dependency versions
javalinVersion = 4.6.3
javalinVersion = 4.6.4
swaggerVersion = 2.1.12
# as defined in SWAGGERUI.version in io/javalin/core/util/OptionalDependency.kt
swaggeruiVersion = 4.10.3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ class ChunkReadingTest {
private val chunkReaderFactory = ChunkReaderFactoryImpl

@BeforeEach
private fun beforeEach() {
fun beforeEach() {
fs = Jimfs.newFileSystem()
}

@AfterEach
private fun afterEach() {
fun afterEach() {
fs.close()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ class ChunkWritingTest {
lateinit var fs: FileSystem

@BeforeEach
private fun beforeEach() {
fun beforeEach() {
fs = Jimfs.newFileSystem()
}

@AfterEach
private fun afterEach() {
fun afterEach() {
fs.close()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ internal class ChunkEntityTest {

@Suppress("Unused")
@AfterAll
private fun cleanup() {
fun cleanup() {
emConfig.close()
entityManagerFactory.close()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class ConfigEntityManagerIntegrationTest {

@Suppress("Unused")
@AfterAll
private fun cleanup() {
fun cleanup() {
dbConfig.close()
entityManagerFactory.close()
}
Expand Down
2 changes: 1 addition & 1 deletion libs/configuration/configuration-validation/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ dependencies {
implementation 'net.corda.kotlin:kotlin-stdlib-jdk8-osgi'
implementation project(":libs:configuration:configuration-core")

implementation "com.fasterxml.jackson.core:jackson-databind:$jacksonDatabindVersion"
implementation "com.fasterxml.jackson.core:jackson-databind:$jacksonVersion"
implementation "com.typesafe:config:$typeSafeConfigVersion"
implementation "com.networknt:json-schema-validator:$networkntJsonSchemaVersion"

Expand Down
2 changes: 1 addition & 1 deletion libs/http-rpc/http-rpc-server-impl/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ dependencies {
testRuntimeOnly "org.slf4j:slf4j-simple:$slf4jVersion"

runtimeOnly "org.webjars:swagger-ui:$swaggeruiVersion"
runtimeOnly "com.fasterxml.jackson.core:jackson-databind:$jacksonDatabindVersion"
runtimeOnly "com.fasterxml.jackson.core:jackson-databind:$jacksonVersion"
runtimeOnly "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jacksonVersion"
runtimeOnly "com.sun.activation:javax.activation:$activationVersion"

Expand Down
2 changes: 1 addition & 1 deletion libs/schema-registry/schema-registry-impl/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ dependencies {
// Transitive dependency bump to eliminate critical violation in NexusIQ report - see nexus iq report.
// Constraints block can be removed when Avro is upgraded to the next version
constraints {
implementation("com.fasterxml.jackson.core:jackson-databind:$jacksonDatabindVersion") {
implementation("com.fasterxml.jackson.core:jackson-databind:$jacksonVersion") {
because 'sonatype-2021-4682'
}
}
Expand Down
2 changes: 1 addition & 1 deletion libs/schema-registry/schema-registry/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ dependencies {
// Transitive dependency bump to eliminate critical violation in NexusIQ report - see nexus iq report.
// Constraints block can be removed when Avro is upgraded to the next version
constraints {
implementation("com.fasterxml.jackson.core:jackson-databind:$jacksonDatabindVersion") {
implementation("com.fasterxml.jackson.core:jackson-databind:$jacksonVersion") {
because 'sonatype-2021-4682'
}
}
Expand Down
Loading

0 comments on commit fe74c6c

Please sign in to comment.