Skip to content

MockitoFixture cannot be used with ResetMocksAfterEachTest #32

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
Krever opened this issue Aug 22, 2018 · 3 comments
Closed

MockitoFixture cannot be used with ResetMocksAfterEachTest #32

Krever opened this issue Aug 22, 2018 · 3 comments

Comments

@Krever
Copy link
Contributor

Krever commented Aug 22, 2018

overriding method withFixture in trait MockitoFixture of type (test: IdentificationServiceSpec.this.NoArgTest)org.scalatest.Outcome;
method withFixture in trait ResetMocksAfterEachTest of type (test: IdentificationServiceSpec.this.NoArgTest)org.scalatest.Outcome has weaker access privileges; it should be public

sorry that I only report issues instead of fixing them immediately in a PR, Im low on time ;/

@ultrasecreth
Copy link
Member

That's all right

I haven't put much effort in this one (maybe I just should document it doesn't work) as both modes are somehow incompatible

This trait is aim for people that must declare their mocks outside the test scope, and as we discussed in #31 the session basically requires the mock to created as part of each test and not as part of the test class

I'm going to think if there is a fancy way to combine both, but tbh, I don't think the use cases overlap, if you were forced to have mocks as class instances then there isn't that much you can do about it

What do you think? is there any use-case in where it make sense to have both class and test level mocks?

@Krever
Copy link
Contributor Author

Krever commented Aug 22, 2018

Nope, your reasoning is fully correct, so I would just mention it explicitly in the docs :)

@ultrasecreth
Copy link
Member

Fixed on #30

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

No branches or pull requests

2 participants