-
Notifications
You must be signed in to change notification settings - Fork 0
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
EDGFQM-8 Add controller pass-through test #9
Conversation
Kudos, SonarCloud Quality Gate passed!
|
JFixture fixture = new JFixture(); | ||
var args = Stream.of(controllerMethod.getParameterTypes()).map(fixture::create).toArray(); |
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.
I usually really dislike JFixture (I usually prefer something like junit-quickcheck instead for randomized testing), but for something like this, where it's not truly randomized testing and we just need some non-null objects of the right types (non-null, so that we can verify that they can be differentiated), it's pretty sweet
serviceMethod.invoke(verify(service, times(1)), args); | ||
clientMethod.invoke(verify(client, times(1)), args); |
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.
These took me a while to figure out, since the normal verify(entityTypesClient, times(1)).doSomething()
way of using verify()
is already pretty magic. Doing it when reflection is involved makes it extra weird and look backwards
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.
I was thinking the same thing when looking at it!
No description provided.