ricardozanini commented on code in PR #3412:
URL:
https://github.com/apache/incubator-kie-kogito-runtimes/pull/3412#discussion_r1499265700
##########
quarkus/extensions/kogito-quarkus-serverless-workflow-extension/kogito-quarkus-serverless-workflow-integration-test/src/test/java/org/kie/kogito/quarkus/workflows/AssuredTestUtils.java:
##########
@@ -73,15 +84,19 @@ static void waitForFinish(String flowName, String id,
Duration duration) {
.statusCode(404));
}
- static CloudEvent buildCloudEvent(String id, String type,
CloudEventMarshaller<byte[]> marshaller) {
- return CloudEventBuilder.v1()
+ static CloudEvent buildCloudEvent(String id, Optional<String> businessKey,
String type, CloudEventMarshaller<byte[]> marshaller) {
+ io.cloudevents.core.v1.CloudEventBuilder builder =
CloudEventBuilder.v1()
.withId(UUID.randomUUID().toString())
.withSource(URI.create(""))
.withType(type)
.withTime(OffsetDateTime.now())
- .withExtension("kogitoprocrefid", id)
-
.withData(marshaller.cloudEventDataFactory().apply(Collections.singletonMap(type,
"This has been injected by the event")))
- .build();
+
.withData(marshaller.cloudEventDataFactory().apply(Collections.singletonMap(type,
"This has been injected by the event")));
+ businessKey.ifPresentOrElse(key ->
builder.withExtension(CloudEventExtensionConstants.BUSINESS_KEY, key), () ->
builder.withExtension(CloudEventExtensionConstants.PROCESS_REFERENCE_ID, id));
Review Comment:
What's the use case to use one or the other? Why not include both if not
empty?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]