Skip to content
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

Mockito optional matchers #51

Merged
merged 4 commits into from
Jun 26, 2016
Merged

Mockito optional matchers #51

merged 4 commits into from
Jun 26, 2016

Conversation

xsveda
Copy link
Contributor

@xsveda xsveda commented Jun 26, 2016

Custom Mockito ArgumentMatcher for Optional that can be used to for enhanced stubbing and verification.
Example:

        Foo foo = mock(Foo.class);
        when(foo.bar(anyPresentOptional())).thenReturn(true);
        when(foo.bar(anyEmptyOptional())).thenReturn(false);

New Mockito matchers are placed in mockito sub-package. It might make sense to move existing Hamcrest matchers to hamcrest sub-package (that would be an API breaking change) or make a standalone test modules: streamTestHamcrest and streamTestMockito. What do you think @aNNiMON ?

@coveralls
Copy link

coveralls commented Jun 26, 2016

Coverage Status

Coverage decreased (-5.6%) to 94.444% when pulling 1316b1d on xsveda:mockito_optional_matchers into f35bcc0 on aNNiMON:master.

@coveralls
Copy link

coveralls commented Jun 26, 2016

Coverage Status

Coverage remained the same at 100.0% when pulling 6bae410 on xsveda:mockito_optional_matchers into f35bcc0 on aNNiMON:master.

@aNNiMON aNNiMON merged commit 7c020bf into aNNiMON:master Jun 26, 2016
@aNNiMON
Copy link
Owner

aNNiMON commented Jun 26, 2016

@xsveda thank you for your pull request. For me, creation of new submodules for each test framework is not necessary, and classes had to be moved to hamcrest package in any case. I'll do it soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants