Skip to content

Commit

Permalink
[TH2-5165] Migrated to cradle api 5.2.0-...
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikita-Smirnov-Exactpro committed Feb 27, 2024
1 parent 1cd4081 commit 1ef19df
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 20 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Report data provider (5.9.5)
# Report data provider (5.10.0)

# Overview
This component serves as a backend for rpt-viewer. It will connect to the cassandra database via cradle api and expose the data stored in there as REST resources.
Expand Down Expand Up @@ -295,7 +295,10 @@ spec:

# Release notes

## 5.9.5
## 5.10.0
+ Updated cradle api: `5.2.0-dev`
+ Updated common: `5.8.0-dev`
+ Updated common-utils: `2.2.2-dev`
+ Disabled unsupported [Cassandra driver metrics](https://docs.datastax.com/en/developer/java-driver/4.10/manual/core/metrics/)

## 5.9.4
Expand Down
14 changes: 7 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ plugins {
id 'org.jetbrains.kotlin.jvm' version '1.8.22'
id 'application'
id 'com.palantir.docker' version '0.25.0'
id "org.owasp.dependencycheck" version "8.3.1"
id "org.owasp.dependencycheck" version "9.0.9"
id "com.gorylenko.gradle-git-properties" version "2.4.1"
id 'com.github.jk1.dependency-license-report' version '2.5'
id "de.undercouch.download" version "5.4.0"
}

ext {
dockerImageVersion = release_version
cradleVersion = '5.1.4-dev'
cradleVersion = '5.2.0-TH2-5165-+'
}

group 'com.exactpro.th2'
Expand Down Expand Up @@ -47,11 +47,11 @@ dependencies {

implementation 'org.apache.commons:commons-lang3'

implementation('com.exactpro.th2:common:5.4.0-dev') {
implementation('com.exactpro.th2:common:5.8.0-dev') {
exclude group: 'com.exactpro.th2', module: 'cradle-core'
exclude group: 'com.exactpro.th2', module: 'cradle-cassandra'
}
implementation 'com.exactpro.th2:common-utils:2.2.0-dev'
implementation 'com.exactpro.th2:common-utils:2.2.2-dev'

implementation "com.exactpro.th2:cradle-core:${cradleVersion}"

Expand All @@ -73,10 +73,10 @@ dependencies {
testImplementation('org.jetbrains.kotlin:kotlin-reflect') {
because('mockk needs it')
}
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.0'
testImplementation "org.junit.jupiter:junit-jupiter-params:5.10.0"
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.2'
testImplementation "org.junit.jupiter:junit-jupiter-params:5.10.2"

testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.2'
}

tasks.withType(KotlinCompile).configureEach {
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@

kotlin.code.style=official

release_version=5.9.5
release_version=5.10.0

docker_image_name=
4 changes: 2 additions & 2 deletions src/test/kotlin/handlers/events/TestEventPipeline.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2022-2023 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.
Expand Down Expand Up @@ -63,7 +63,7 @@ class TestEventPipeline {
private val endTimestamp = Instant.parse("2022-04-21T01:15:00Z")

private val batchSize = 4096
private val pageId = PageId(BookId("testBook"), "testPage")
private val pageId = PageId(BookId("testBook"), startTimestamp,"testPage")
private val scope = "testScope"

private val eventsFromStartToEnd11 = createEvents("1", startTimestamp, endTimestamp)
Expand Down
18 changes: 10 additions & 8 deletions src/test/kotlin/handlers/messages/ExtractorTest.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2022-2023 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.
Expand Down Expand Up @@ -37,6 +37,7 @@ import com.exactpro.th2.rptdataprovider.services.cradle.CradleService
import io.mockk.coEvery
import io.mockk.every
import io.mockk.mockk
import kotlinx.coroutines.DelicateCoroutinesApi
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.cancelChildren
import kotlinx.coroutines.channels.Channel
Expand Down Expand Up @@ -65,7 +66,7 @@ class ExtractorTest {
private val baseStreamName = "test_stream"
private val streamDirection = "FIRST"

private val BOOK = BookId("")
private val bookId = BookId("")
private val fullStreamName = "${baseStreamName}:${streamDirection}"
private val streamNameObject = StreamName(baseStreamName, Direction.valueOf(streamDirection), BookId(""))

Expand Down Expand Up @@ -93,7 +94,7 @@ class ExtractorTest {
"direction" to listOf(streamDirection),
"startTimestamp" to listOf(startTimestamp.toEpochMilli().toString()),
"endTimestamp" to listOf(endTimestamp.toEpochMilli().toString()),
"bookId" to listOf(BOOK.name)
"bookId" to listOf(bookId.name)
)
if (resumeId != null) {
parameters["messageId"] = listOf(resumeId.toString())
Expand All @@ -113,10 +114,10 @@ class ExtractorTest {
every { msg.sessionAlias } answers { fullStreamName }
every { msg.protocol } answers { "protocol" }
every { msg.direction } answers { Direction.FIRST }
every { msg.getContent() } answers { byteArrayOf(1, 1, 1) }
every { msg.getId() } answers {
every { msg.content } answers { byteArrayOf(1, 1, 1) }
every { msg.id } answers {
StoredMessageId(
BOOK,
bookId,
baseStreamName,
Direction.valueOf(streamDirection),
timestamp,
Expand All @@ -128,6 +129,7 @@ class ExtractorTest {
return msg
}

@OptIn(DelicateCoroutinesApi::class)
private fun mockContextWithCradleService(batch: StoredMessageBatch): ProtoContext {
val context: ProtoContext = mockk()

Expand Down Expand Up @@ -187,7 +189,7 @@ class ExtractorTest {
startTimestamp = endTimestamp.plusNanos(1)
}

return StoredMessageBatch(allMessages, PageId(BookId("1"), "1"), Instant.now())
return StoredMessageBatch(allMessages, PageId(BookId("1"), start,"1"), Instant.now())
}


Expand Down Expand Up @@ -250,7 +252,7 @@ class ExtractorTest {

allMessages.add(getMessage(endTimestamp, index))

return StoredMessageBatch(allMessages, PageId(BookId("1"), "1"), Instant.now())
return StoredMessageBatch(allMessages, PageId(BookId("1"), startTimestamp, "1"), Instant.now())
}

private fun testBorders(
Expand Down

0 comments on commit 1ef19df

Please sign in to comment.