-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Workflow tester improvements #318
Workflow tester improvements #318
Conversation
…hods. I initially made it an explicit argument because I thought it increased readability, but after writing a bunch of tests, and occasionally using different names for that argument, since the entire point of the lambda passed to `Workflow.test*` methods is to operator on the `WorkflowTester` I think it's actually more readable as a receiver.
55d7f00
to
02f72fe
Compare
@Suppress("DEPRECATION") | ||
val cancelled = context.cancel(error) | ||
if (!cancelled) { | ||
val cancellationCause = context[Job]!!.getCancellationException() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
requireNotNull()
would give better error message in case of NPE.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not possible to have a null here, since we explicitly give the context a Job
on line 262. If it does have a null, someone edited this file and broke something, and I'm not worried about the error message in that case.
Neat, neat! |
Three commits:
I initially made it an explicit argument because I thought it increased readability,
but after writing a bunch of tests, and occasionally using different names for that
argument, since the entire point of the lambda passed to
Workflow.test*
methods isto operator on the
WorkflowTester
I think it's actually more readable as a receiver.