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

refactor: simplify assertions in AnnotationTest.java #2426

Merged
merged 3 commits into from
Sep 1, 2018
Merged

refactor: simplify assertions in AnnotationTest.java #2426

merged 3 commits into from
Sep 1, 2018

Conversation

zielint0
Copy link
Contributor

@zielint0 zielint0 commented Aug 30, 2018

Use straightforward assertion - assertEquals for testing equality.

assertTrue(annotations.get(0).getAnnotatedElement().equals(pkg));

-->

assertEquals(pkg, annotations.get(0).getAnnotatedElement());

@@ -299,7 +299,7 @@ public void testAnnotatedElementTypes() {
// check annotated element type of the package annotation
List<CtAnnotation<?>> annotations = pkg.getAnnotations();
assertEquals(2, annotations.size());
assertTrue(annotations.get(0).getAnnotatedElement().equals(pkg));
assertEquals(annotations.get(0).getAnnotatedElement(), pkg);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the expected value should be first.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@monperrus
Thanks! I fixed this one.

Could you check other tests I modified?

@pvojtechovsky
Copy link
Collaborator

@zielint0 All the AssertEquals of this PR (excluding the one you already fixed) needs to switch parameters: the expected value should be first.

@pvojtechovsky pvojtechovsky changed the title refactor: simplify assertions in AnnotationTest.java WiP: refactor: simplify assertions in AnnotationTest.java Aug 31, 2018
@zielint0 zielint0 changed the title WiP: refactor: simplify assertions in AnnotationTest.java refactor: simplify assertions in AnnotationTest.java Aug 31, 2018
@zielint0
Copy link
Contributor Author

@pvojtechovsky
Thank you Pavel. I suspected that more changes are needed but was not sure.
Please verify again.

Copy link
Collaborator

@pvojtechovsky pvojtechovsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you Tomasz

@pvojtechovsky pvojtechovsky merged commit b2989ea into INRIA:master Sep 1, 2018
@zielint0 zielint0 deleted the refactor-simplify-assertions-AnnotationTest.java branch September 4, 2018 17:57
@monperrus monperrus mentioned this pull request Sep 20, 2018
4 tasks
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.

3 participants