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

Fix handling methods with annotated parameters and test suite #1

Merged
merged 3 commits into from
Nov 9, 2015

Conversation

akozhemiakin
Copy link
Contributor

The problem with current version of the test suite is that it actually covers only first test executed. The reason is all test cases use the same set of configuration parameters (test.*). After the first test gets executed, all configuration parameters are already bound. It leads to a situation when all following tests become nearly useless. In particular, provided pojo test succeeds despite of the invalid resolution of methods with annotate parameters logic (see below).
The goal of this fix is to provide separate data set to each test case (pojo via constructor, pojo via fields, pojo via methods and provided pojo).

Also this pull request provides a fix to the invalid methods with annotated parameters resolution. Currently "org.reflections.Reflections.getMethodsAnnotatedWith" method is used to retrieve methods with annotated parameters. However, this method searches for methods annotated with some annotation, not the methods with annotated parameters. I believe "org.reflections.Reflections.getMethodsWithAnyParamAnnotated" method would be the correct one in this case.

The problem with current version of the test suite is that it actualy covers only first test executed.
The reason is all test cases use the same set of configuration parameters (test.*). After the first test gets executed,
all configuration parameters are already bound. It leads to a situation when all following tests become nearly useless.
This goal of this commit is to provide separate data set to each test case (pojo via constructor, pojo via fields,
pojo via methods and provided pojo).
@racc
Copy link
Owner

racc commented Nov 9, 2015

Thanks for this - nice find!

@racc racc closed this Nov 9, 2015
@racc racc reopened this Nov 9, 2015
racc added a commit that referenced this pull request Nov 9, 2015
Fix handling methods with annotated parameters and test suite
@racc racc merged commit 8b9a0d1 into racc:master Nov 9, 2015
@akozhemiakin akozhemiakin deleted the fix branch November 9, 2015 10:28
@akozhemiakin
Copy link
Contributor Author

Thanks for merging and for developing this very useful module. Please, publish fixed version to maven central when you have time.

@racc
Copy link
Owner

racc commented Nov 9, 2015

Thanks for the feedback! I've published version 0.0.2 which includes your fix.

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

Successfully merging this pull request may close these issues.

2 participants