Conversation
Moved CheckMetadata and ReceiverContext from Handler Updated common version to 3.19.0 Updated grpc-check1 version to 3.3.0
|
Could you please a template for act testing? It should be a test class that allows configuring messages in MQ and checking how the "act" acts |
| release_version = 3.4.1 | ||
| release_version=3.5.0 | ||
| grpc_act_version=3.2.0 | ||
| kotlin_version=1.5.20 |
There was a problem hiding this comment.
Could you please reduce the version of kotlin to 1.3.72 or 1.4.32 because they are more trusted
| import static com.exactpro.th2.common.grpc.RequestStatus.Status.SUCCESS; | ||
| import static java.util.Objects.requireNonNull; | ||
|
|
||
| public class CheckMetadata { |
There was a problem hiding this comment.
Maybe convert to Kotlin
| responseObserver: StreamObserver<PlaceMessageResponse> | ||
| ) { | ||
| runCatching { | ||
| LOGGER.debug { "placeOrderFIX request: $request}" } |
There was a problem hiding this comment.
Please use TextFormat.shotDebug... or convert to JSON format to get a one-line value.
| ) { | ||
| runCatching { | ||
| LOGGER.debug { "placeOrderFIX request: $request}" } | ||
| val expectedValue = requireNotNull(request.message.fieldsMap["ClOrdID"]) |
There was a problem hiding this comment.
Please add a lazy message to clarify exception for user
| LOGGER.debug { "placeQuoteResponseFIX request: $request" } | ||
| val expectedValue = requireNotNull(request.message.fieldsMap["RFQID"]) | ||
| val settings = CallSettings("placeQuoteResponseFIX", expectedValue.simpleValue, mapOf("ExecutionReport" to "RFQID", "QuoteStatusReport" to "RFQID")) | ||
| placeMessage(settings, request, responseObserver) |
There was a problem hiding this comment.
This part is different for calls, but other code in this method looks like a boilerplate.
Maybe create a common method and pass a lambda to extract the expected field into it.
| } | ||
|
|
||
| private fun placeMessage(settings: CallSettings, request: PlaceMessageRequest, responseObserver: StreamObserver<PlaceMessageResponse>) { | ||
| LOGGER.debug { "Begin place ${settings.name} ${shortDebugString(request)}" } |
There was a problem hiding this comment.
We already logged a similar message in every gRPC methods
| status(if (status) PASSED else FAILED) | ||
| bodyData(response.toTreeTable()) | ||
| messageID(response.metadata.id) | ||
| }.toProtoEvent(parentEventId.id)) |
There was a problem hiding this comment.
| }.toProtoEvent(parentEventId.id)) | |
| }.toProto(parentEventId)) |
| ) { | ||
| responseMessage?.let { response -> | ||
| val status: Boolean = BooleanUtils.toBoolean( | ||
| response.requiredField(REQUIRED_FIELD, SIMPLE_VALUE).simpleValue |
There was a problem hiding this comment.
Are you sure about the REQUIRED_FIELD fixed value for all cases?
No description provided.