easymock / easymock/easymock

Lambda Support to tidy up expectations

Open
#210 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
HTML
Stars
832
Forks
303
Avg merge
5h 25m
Merged PRs (30d)
9

Description

Currently, when you write expectations you've got to deal with the fact that the signatures could throw. This means that your test methods need to indicate all of these exceptions even if they will never happen.

Java 8 Lambdas could ease this. For example:

```
EasyMock.expect(() -> {
EasyMock.expect(target.callThatThrows())
.andThrow(new Exception());
});
```

You could even extend this to do a Replay at the end of the lambda for all the mocks that were configured in it.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.