[
https://issues.apache.org/jira/browse/FLINK-22750?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17349340#comment-17349340
]
Konstantin Knauf commented on FLINK-22750:
------------------------------------------
I see two possible approaches:
1) A long the lines of
https://github.com/ververica/flink-statefun-workshop/tree/exercise/workshop/tests,
where the StatefulFunction under test is wrapped in a RequestReplyHandler and
we provide a utility to construct an invocation including state and call
information. This would involve a bit more magic than a unit test usually does.
It feels similar to Flink's OperatorTestHarnesses.
2) A mock/test implementation of `Context` that allows to set/get state and to
get the sent (egress)messages as a list. This would be very close to a
classical unit test.
[~igal] [~tzulitai] [~sjwiesman] any preferences?
> Simplify Unit Testing of Remote Functions
> -----------------------------------------
>
> Key: FLINK-22750
> URL: https://issues.apache.org/jira/browse/FLINK-22750
> Project: Flink
> Issue Type: Improvement
> Components: Build System / Stateful Functions
> Reporter: Konstantin Knauf
> Priority: Minor
>
> Testing Remote Functions in isolation is currently more cumbersome than it
> would need to be, particularly because there is no easy way to supply state
> to a StatefulFunctions or to assert on sent messages.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)