Skip to content

Commit

Permalink
[TH2-5143] Updated dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikita-Smirnov-Exactpro committed Dec 7, 2023
1 parent 4537fce commit 22cebf1
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 21 deletions.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# HTTP Codec v0.4.0
# HTTP Codec v0.5.0

This microservice can encode and decode HTTP messages

Expand Down Expand Up @@ -129,6 +129,13 @@ It's been verified that Sailfish itself is compatible with versions from BOM and
# Release notes
## 0.5.0
+ Updated common: `5.7.2-dev`
+ Updated common-utils: `2.2.2-dev`
+ Updated codec: `5.4.1-dev`
+ Updated sailfish-utils: `4.1.1-dev`

## 0.4.0

+ th2 transport protocol support
Expand Down
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@ jar {
dependencies {
api platform("com.exactpro.th2:bom:4.5.0")

implementation "com.exactpro.th2:common:5.4.0-dev"
implementation "com.exactpro.th2:common-utils:2.2.0-dev"
implementation "com.exactpro.th2:codec:5.3.0-new-proto-+"
implementation "com.exactpro.th2:common:5.7.2-TH2-5143-+"
implementation "com.exactpro.th2:common-utils:2.2.2-dev"
implementation "com.exactpro.th2:codec:5.4.1-TH2-5143-+"

implementation "com.exactpro.th2:sailfish-utils:4.1.0-dev"
implementation "com.exactpro.th2:sailfish-utils:4.1.1-dev"

compileOnly "com.google.auto.service:auto-service:1.1.1"
annotationProcessor "com.google.auto.service:auto-service:1.1.1"
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
kotlin.code.style=official
kotlin_version=1.8.22
release_version=0.4.0
release_version=0.5.0
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package com.exactpro.th2.codec.http

import com.exactpro.th2.codec.api.IPipelineCodec
import com.exactpro.th2.codec.api.IReportingContext
import com.exactpro.th2.codec.http.HttpPipelineCodecFactory.Companion.PROTOCOL
import com.exactpro.th2.common.grpc.AnyMessage.KindCase.MESSAGE
import com.exactpro.th2.common.grpc.AnyMessage.KindCase.RAW_MESSAGE
Expand Down Expand Up @@ -57,7 +58,7 @@ import com.exactpro.th2.common.grpc.RawMessage as ProtoRawMessage

class HttpPipelineCodec : IPipelineCodec {

override fun encode(messageGroup: ProtoMessageGroup): ProtoMessageGroup {
override fun encode(messageGroup: ProtoMessageGroup, context: IReportingContext): ProtoMessageGroup {
val messages = messageGroup.messagesList

require(messages.size <= 2) { "Message group must contain at most 2 messages" }
Expand Down Expand Up @@ -131,7 +132,7 @@ class HttpPipelineCodec : IPipelineCodec {
return builder.build()
}

override fun encode(messageGroup: MessageGroup): MessageGroup {
override fun encode(messageGroup: MessageGroup, context: IReportingContext): MessageGroup {
val messages = messageGroup.messages

require(messages.size <= 2) { "Message group must contain at most 2 messages" }
Expand Down Expand Up @@ -201,7 +202,7 @@ class HttpPipelineCodec : IPipelineCodec {
return MessageGroup(encodedMessages)
}

override fun decode(messageGroup: ProtoMessageGroup): ProtoMessageGroup {
override fun decode(messageGroup: ProtoMessageGroup, context: IReportingContext): ProtoMessageGroup {
val messages = messageGroup.messagesList

require(messages.size == 1) { "Message group must contain only 1 message" }
Expand Down Expand Up @@ -231,7 +232,7 @@ class HttpPipelineCodec : IPipelineCodec {
return builder.build()
}

override fun decode(messageGroup: MessageGroup): MessageGroup {
override fun decode(messageGroup: MessageGroup, context: IReportingContext): MessageGroup {
val messages = messageGroup.messages

require(messages.size == 1) { "Message group must contain only 1 message" }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2020-2022 Exactpro (Exactpro Systems Limited)
* Copyright 2020-2023 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 All @@ -25,12 +25,12 @@ import com.google.auto.service.AutoService
@AutoService(IPipelineCodecFactory::class)
class HttpPipelineCodecFactory : IPipelineCodecFactory {
override val settingsClass: Class<out IPipelineCodecSettings> = HttpPipelineCodecSettings::class.java
@Deprecated("Please migrate to the protocols property")
override val protocol: String = PROTOCOL
override val protocols: Set<String> get() = PROTOCOLS
override fun init(pipelineCodecContext: IPipelineCodecContext) = Unit
override fun create(settings: IPipelineCodecSettings?): IPipelineCodec = HttpPipelineCodec()

companion object {
const val PROTOCOL = "http"
private val PROTOCOLS = setOf(PROTOCOL)
}
}
9 changes: 5 additions & 4 deletions src/test/kotlin/com/exactpro/th2/codec/http/DecodeTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package com.exactpro.th2.codec.http

import com.exactpro.th2.codec.api.impl.ReportingContext
import com.exactpro.th2.codec.http.HttpPipelineCodecFactory.Companion.PROTOCOL
import com.exactpro.th2.common.schema.message.impl.rabbitmq.transport.RawMessage
import com.exactpro.th2.common.schema.message.impl.rabbitmq.transport.ParsedMessage
Expand Down Expand Up @@ -58,7 +59,7 @@ class DecodeTest {

val messageGroup = ProtoMessageGroup.newBuilder().addMessages(ProtoAnyMessage.newBuilder().setRawMessage(message).build()).build()

val decodedEventID = codec.decode(messageGroup).getMessages(0).message.parentEventId
val decodedEventID = codec.decode(messageGroup, ReportingContext()).getMessages(0).message.parentEventId

assertEquals(eventID, decodedEventID.id)
}
Expand All @@ -84,7 +85,7 @@ class DecodeTest {

val messageGroup = ProtoMessageGroup.newBuilder().addMessages(ProtoAnyMessage.newBuilder().setRawMessage(message).build()).build()

val decodedEventID = codec.decode(messageGroup).getMessages(0).message.parentEventId
val decodedEventID = codec.decode(messageGroup, ReportingContext()).getMessages(0).message.parentEventId

assertEquals(eventID, decodedEventID.id)
}
Expand All @@ -110,7 +111,7 @@ class DecodeTest {

val messageGroup = MessageGroup(listOf(message))

val decodedGroup = codec.decode(messageGroup)
val decodedGroup = codec.decode(messageGroup, ReportingContext())

val decodedMessage = decodedGroup.messages[0] as ParsedMessage

Expand Down Expand Up @@ -151,7 +152,7 @@ class DecodeTest {

val messageGroup = MessageGroup(listOf(message))

val decodedGroup = codec.decode(messageGroup)
val decodedGroup = codec.decode(messageGroup, ReportingContext())

assertEquals(1, decodedGroup.messages.size)

Expand Down
9 changes: 5 additions & 4 deletions src/test/kotlin/com/exactpro/th2/codec/http/EncodeTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package com.exactpro.th2.codec.http

import com.exactpro.th2.codec.api.impl.ReportingContext
import com.exactpro.th2.codec.http.HttpPipelineCodecFactory.Companion.PROTOCOL
import com.exactpro.th2.common.grpc.AnyMessage as ProtoAnyMessage
import com.exactpro.th2.common.grpc.Message as ProtoMessage
Expand Down Expand Up @@ -47,7 +48,7 @@ class EncodeTest {

val messageGroup = ProtoMessageGroup.newBuilder().addMessages(ProtoAnyMessage.newBuilder().setMessage(message).build()).build()

val encodedEventID = codec.encode(messageGroup).getMessages(0).rawMessage.parentEventId
val encodedEventID = codec.encode(messageGroup, ReportingContext()).getMessages(0).rawMessage.parentEventId

assertEquals(eventID, encodedEventID.id)
}
Expand All @@ -66,7 +67,7 @@ class EncodeTest {
}

val messageGroup = ProtoMessageGroup.newBuilder().addMessages(ProtoAnyMessage.newBuilder().setMessage(message).build()).build()
val encodedEventID = codec.encode(messageGroup).getMessages(0).rawMessage.parentEventId
val encodedEventID = codec.encode(messageGroup, ReportingContext()).getMessages(0).rawMessage.parentEventId

assertEquals(eventID, encodedEventID.id)
}
Expand All @@ -87,7 +88,7 @@ class EncodeTest {
)

val messageGroup = MessageGroup(listOf(message))
val encodedGroup = codec.encode(messageGroup)
val encodedGroup = codec.encode(messageGroup, ReportingContext())
val encodedMessage = encodedGroup.messages[0] as RawMessage
val encodedEventID = encodedMessage.eventId

Expand All @@ -113,7 +114,7 @@ class EncodeTest {
)

val messageGroup = MessageGroup(listOf(message))
val encodedGroup = codec.encode(messageGroup)
val encodedGroup = codec.encode(messageGroup, ReportingContext())

val encodedMessage = encodedGroup.messages[0] as RawMessage
val encodedEventID = encodedMessage.eventId
Expand Down

0 comments on commit 22cebf1

Please sign in to comment.