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

EDGFQM-8 Add controller pass-through test #9

Merged
merged 1 commit into from
Sep 21, 2023

Conversation

mweaver-ebsco
Copy link
Collaborator

No description provided.

@CLAassistant
Copy link

CLAassistant commented Sep 21, 2023

CLA assistant check
All committers have signed the CLA.

@sonarcloud
Copy link

sonarcloud bot commented Sep 21, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Comment on lines +79 to +80
JFixture fixture = new JFixture();
var args = Stream.of(controllerMethod.getParameterTypes()).map(fixture::create).toArray();
Copy link
Collaborator Author

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

Comment on lines +86 to +87
serviceMethod.invoke(verify(service, times(1)), args);
clientMethod.invoke(verify(client, times(1)), args);
Copy link
Collaborator Author

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

Copy link
Collaborator

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!

@mweaver-ebsco mweaver-ebsco merged commit adae385 into master Sep 21, 2023
4 checks passed
@mweaver-ebsco mweaver-ebsco deleted the EDGFQM-8-passthrough-test branch September 21, 2023 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants