diff --git a/build.gradle b/build.gradle index 9750442..7dbe4be 100644 --- a/build.gradle +++ b/build.gradle @@ -1,19 +1,18 @@ plugins { - id 'com.palantir.docker' version '0.25.0' - id 'org.jetbrains.kotlin.jvm' version '1.6.21' - id 'org.jetbrains.kotlin.kapt' version "1.6.21" - id 'java' - id 'application' + id "application" + id "org.jetbrains.kotlin.jvm" version "1.8.22" + id "org.jetbrains.kotlin.kapt" version "1.8.22" + id "com.exactpro.th2.gradle.component" version "0.1.4" } group 'com.exactpro.th2' version release_version -sourceCompatibility = JavaVersion.VERSION_11 -targetCompatibility = JavaVersion.VERSION_11 +kotlin { + jvmToolchain(11) +} repositories { - mavenLocal() mavenCentral() maven { name 'Sonatype_snapshots' @@ -23,47 +22,35 @@ repositories { name 'Sonatype_releases' url 'https://s01.oss.sonatype.org/content/repositories/releases/' } + mavenLocal() - configurations.all { + configurations.configureEach { resolutionStrategy.cacheChangingModulesFor 0, 'seconds' resolutionStrategy.cacheDynamicVersionsFor 0, 'seconds' } } -jar { - manifest { - attributes( - 'Created-By': "${System.getProperty('java.version')} (${System.getProperty('java.vendor')})", - 'Specification-Title': '', - 'Specification-Vendor': 'Exactpro Systems LLC', - 'Implementation-Title': project.archivesBaseName, - 'Implementation-Vendor': 'Exactpro Systems LLC', - 'Implementation-Vendor-Id': 'com.exactpro', - 'Implementation-Version': project.version - ) - } -} - dependencies { - api platform('com.exactpro.th2:bom:4.0.2') - compileOnly 'com.google.auto.service:auto-service:1.0.1' kapt 'com.google.auto.service:auto-service:1.0.1' - implementation 'com.github.ben-manes.caffeine:caffeine:3.1.2' + implementation 'com.github.ben-manes.caffeine:caffeine:3.1.8' + implementation 'io.github.microutils:kotlin-logging:3.0.5' + implementation 'com.fasterxml.jackson.core:jackson-databind:2.18.1' + implementation 'com.fasterxml.jackson.core:jackson-annotations:2.18.1' + + implementation 'com.exactpro.th2:common:5.14.0-dev' + implementation "com.exactpro.th2:common-utils:2.3.0-dev" + implementation "com.exactpro.th2:processor-core:0.3.0-dev" - implementation 'com.exactpro.th2:common:4.0.0-TH2-4262-reduce-load-book-and-page-3574992387-SNAPSHOT' - implementation "com.exactpro.th2:common-utils:0.0.1-book-and-page-3572891451-SNAPSHOT" - implementation "com.exactpro.th2:processor-core:0.0.1-TH2-4262-reduce-load-book-and-page-3739179455-7524a15-SNAPSHOT" + implementation "com.exactpro.th2:cradle-cassandra:5.4.4-dev" - implementation "com.exactpro.th2:cradle-cassandra:4.0.0-dev-version-4-2548754188-SNAPSHOT" testImplementation "org.jetbrains.kotlin:kotlin-test-junit5" - testImplementation 'org.mockito.kotlin:mockito-kotlin:4.1.0' + testImplementation 'org.mockito.kotlin:mockito-kotlin:5.4.0' - testImplementation "org.junit.jupiter:junit-jupiter-api:5.9.0" - testImplementation "org.junit.jupiter:junit-jupiter-params:5.9.0" - testRuntimeOnly("org.junit.jupiter:junit-jupiter:5.9.0") + testImplementation "org.junit.jupiter:junit-jupiter-params:5.11.3" + testImplementation "org.junit.jupiter:junit-jupiter:5.11.3" } @@ -73,18 +60,4 @@ test { application { mainClass.set('com.exactpro.th2.processor.MainKt') -} - -applicationName = 'service' - -distTar { - archiveName "${applicationName}.tar" -} - -dockerPrepare { - dependsOn distTar -} - -docker { - copySpec.from(tarTree("$buildDir/distributions/${applicationName}.tar")) -} +} \ No newline at end of file diff --git a/src/test/kotlin/com/exactpro/th2/processor/healer/ProcessorTest.kt b/src/test/kotlin/com/exactpro/th2/processor/healer/ProcessorTest.kt index b47bb2f..b5ed525 100644 --- a/src/test/kotlin/com/exactpro/th2/processor/healer/ProcessorTest.kt +++ b/src/test/kotlin/com/exactpro/th2/processor/healer/ProcessorTest.kt @@ -1,5 +1,5 @@ /* - * Copyright 2022 Exactpro (Exactpro Systems Limited) + * Copyright 2022-2024 Exactpro (Exactpro Systems Limited) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -245,8 +245,8 @@ class ProcessorTest { verify(cradleStorage, times(3).description("Load events")).getTestEvent(any()) verify(cradleStorage, never().description("Update event A")).updateEventStatus(eq(eventA), eq(false)) - verify(cradleStorage, times(1).description("Update event B")).updateEventStatus(eq(eventB), eq(false)) - verify(cradleStorage, times(1).description("Update event C")).updateEventStatus(eq(eventC), eq(false)) + verify(cradleStorage, times(2).description("Update event B")).updateEventStatus(eq(eventB), eq(false)) + verify(cradleStorage, times(2).description("Update event C")).updateEventStatus(eq(eventC), eq(false)) verify(cradleStorage, never().description("Update event D")).updateEventStatus(eq(eventD), eq(false)) verify(cradleStorage, times(2).description("Update events")).updateEventStatus(any(), any()) @@ -396,7 +396,7 @@ class ProcessorTest { success, ByteArray(10), emptySet(), - PageId(bookId, PAGE_NAME), + PageId(bookId, PAGE_TIMESTAMP, PAGE_NAME), null, Instant.now() ) @@ -410,6 +410,7 @@ class ProcessorTest { private const val C_EVENT_ID = "c_event_id" private const val D_EVENT_ID = "d_event_id" + private val PAGE_TIMESTAMP = Instant.now() private val SETTINGS = Settings(1, 1, TimeUnit.MILLISECONDS, 3) private val PROCESSOR_EVENT_ID = EventID.newBuilder().apply { bookName = BOOK_NAME