tzulitai commented on a change in pull request #43: [FLINK-16391][http] Add
DelayedMessages and EgressMessages
URL: https://github.com/apache/flink-statefun/pull/43#discussion_r386757212
##########
File path:
statefun-flink/statefun-flink-core/src/test/java/org/apache/flink/statefun/flink/core/reqreply/RequestReplyFunctionTest.java
##########
@@ -157,6 +164,52 @@ public void stateIsModified() {
assertThat(client.capturedState(0), is(ByteString.copyFromUtf8("hello")));
}
+ @Test
+ public void delayedMessages() {
+ functionUnderTest.invoke(context, Any.getDefaultInstance());
+
+ // A message returned from the function
+ // that asks to put "hello" into the session state.
+ FromFunction response =
+ FromFunction.newBuilder()
+ .setInvocationResult(
+ InvocationResponse.newBuilder()
+ .addDelayedInvocations(
+ DelayedInvocation.newBuilder()
+ .setArgument(Any.getDefaultInstance())
+ .setDelayInMs(1)
+ .build()))
+ .build();
+
+ functionUnderTest.invoke(context, successfulAsyncOperation(response));
+
+ assertFalse(context.delayed.isEmpty());
+ assertEquals(Duration.ofMillis(1), context.delayed.get(0).getKey());
+ }
+
+ @Test
+ public void egressIsSent() {
+ functionUnderTest.invoke(context, Any.getDefaultInstance());
+
+ // A message returned from the function
+ // that asks to put "hello" into the session state.
Review comment:
same here: this comment is not coherent with the code
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services