You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2020/02/17 13:34:51 UTC
[GitHub] [flink-statefun] igalshilman commented on issue #22:
[FLINK-16002][statefun][testutil] Add stateful functions test utilities
igalshilman commented on issue #22: [FLINK-16002][statefun][testutil] Add stateful functions test utilities
URL: https://github.com/apache/flink-statefun/pull/22#issuecomment-586996294
We had a discussion with Seth offline, and I definitely think there is need for this test kit.
To summarize the discussion:
There are these two ways of approaching unit testing this (probably more)
a) would be just call the stateful function with some TestContext and make assertions on the side effects.
Something a long the lines of
```
assertThat(functionUnderTest.invoke(context, message), allOf(
hasOutgoingMessage( messageMatches(...) )
hasOutgoingEgress( ... )
hasDelayedMessages( ...)
);
```
b) actually simulate some stuff happening, and later collecting the results
and asserting on the expected behaviour.
This PR leans towards (b) and I can definitely see the value of that after seeing some examples, so I'm +1 to bring this to shape and merge this, I also like the use of matchers they make the tests more readable!
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services