You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by GitBox <gi...@apache.org> on 2022/10/20 17:07:52 UTC

[GitHub] [wicket] vandeven opened a new pull request, #545: Cleanup JUnit 5 assertions

vandeven opened a new pull request, #545:
URL: https://github.com/apache/wicket/pull/545

   Ran the Clean Up Assertions recipe from the OpenRewrite project (https://docs.openrewrite.org/reference/recipes/java/testing/junit5/cleanupassertions version 1.30.0).
   
   Had to do 1 manual change to SpringBeanTest to make sure the == bean check was not replaced by assertEquals


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@wicket.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [wicket] timtebeek commented on a diff in pull request #545: Cleanup JUnit 5 assertions

Posted by GitBox <gi...@apache.org>.
timtebeek commented on code in PR #545:
URL: https://github.com/apache/wicket/pull/545#discussion_r1001597087


##########
wicket-spring/src/test/java/org/apache/wicket/spring/FieldBeansCollectorTest.java:
##########
@@ -40,7 +40,7 @@ public void resolveGenericList() throws Exception
 
 		FieldBeansCollector fieldBeansCollector = new FieldBeansCollector(resolvableType);
 
-		assertTrue(fieldBeansCollector.getFieldType() == FieldType.LIST);
+		assertEquals(fieldBeansCollector.getFieldType(), FieldType.LIST);

Review Comment:
   I'll let you know what I find & apply that here. :)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@wicket.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [wicket] martin-g commented on pull request #545: WICKET-7011: Cleanup JUnit 5 assertions

Posted by GitBox <gi...@apache.org>.
martin-g commented on PR #545:
URL: https://github.com/apache/wicket/pull/545#issuecomment-1286896241

   Thank you, @vandeven & @timtebeek !
   
   Please use https://issues.apache.org/jira/browse/WICKET-7011 as a ticket reference for any further work on this topic!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@wicket.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [wicket] timtebeek commented on a diff in pull request #545: WICKET-7011: Cleanup JUnit 5 assertions

Posted by GitBox <gi...@apache.org>.
timtebeek commented on code in PR #545:
URL: https://github.com/apache/wicket/pull/545#discussion_r1005333329


##########
wicket-spring/src/test/java/org/apache/wicket/spring/FieldBeansCollectorTest.java:
##########
@@ -40,7 +40,7 @@ public void resolveGenericList() throws Exception
 
 		FieldBeansCollector fieldBeansCollector = new FieldBeansCollector(resolvableType);
 
-		assertTrue(fieldBeansCollector.getFieldType() == FieldType.LIST);
+		assertEquals(fieldBeansCollector.getFieldType(), FieldType.LIST);

Review Comment:
   Picked up in https://github.com/apache/wicket/pull/546



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@wicket.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [wicket] martin-g merged pull request #545: WICKET-7011: Cleanup JUnit 5 assertions

Posted by GitBox <gi...@apache.org>.
martin-g merged PR #545:
URL: https://github.com/apache/wicket/pull/545


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@wicket.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [wicket] timtebeek commented on a diff in pull request #545: WICKET-7011: Cleanup JUnit 5 assertions

Posted by GitBox <gi...@apache.org>.
timtebeek commented on code in PR #545:
URL: https://github.com/apache/wicket/pull/545#discussion_r1002499905


##########
wicket-spring/src/test/java/org/apache/wicket/spring/FieldBeansCollectorTest.java:
##########
@@ -40,7 +40,7 @@ public void resolveGenericList() throws Exception
 
 		FieldBeansCollector fieldBeansCollector = new FieldBeansCollector(resolvableType);
 
-		assertTrue(fieldBeansCollector.getFieldType() == FieldType.LIST);
+		assertEquals(fieldBeansCollector.getFieldType(), FieldType.LIST);

Review Comment:
   Logged as a [possible improvement here](https://github.com/openrewrite/rewrite-testing-frameworks/issues/275). Once that's automated we can again apply it here, to also migrate any other imperfectly placed argument orders.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@wicket.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [wicket] timtebeek commented on a diff in pull request #545: Cleanup JUnit 5 assertions

Posted by GitBox <gi...@apache.org>.
timtebeek commented on code in PR #545:
URL: https://github.com/apache/wicket/pull/545#discussion_r1001595216


##########
wicket-spring/src/test/java/org/apache/wicket/spring/FieldBeansCollectorTest.java:
##########
@@ -40,7 +40,7 @@ public void resolveGenericList() throws Exception
 
 		FieldBeansCollector fieldBeansCollector = new FieldBeansCollector(resolvableType);
 
-		assertTrue(fieldBeansCollector.getFieldType() == FieldType.LIST);
+		assertEquals(fieldBeansCollector.getFieldType(), FieldType.LIST);

Review Comment:
   I'd been meaning to write or look for a recipe on that; "if either argument is a literal, that argument should come first".



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@wicket.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [wicket] martin-g commented on pull request #545: Cleanup JUnit 5 assertions

Posted by GitBox <gi...@apache.org>.
martin-g commented on PR #545:
URL: https://github.com/apache/wicket/pull/545#issuecomment-1286655770

   > Would you appreciate a few more such automated fixes?
   
   Sure!
   Thank you!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@wicket.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [wicket] timtebeek commented on pull request #545: Cleanup JUnit 5 assertions

Posted by GitBox <gi...@apache.org>.
timtebeek commented on PR #545:
URL: https://github.com/apache/wicket/pull/545#issuecomment-1286628517

   Glad to see this approved so quickly @martin-g ! :) Would you appreciate a few more such automated fixes?
   I understand it's a fine balance to not overwhelm you with review requests when applying such automations.
   
   Here's a few quick suggestions and their possible impact on the source code:
   
   - [ ] [JUnit Jupiter best practices](https://docs.openrewrite.org/reference/recipes/java/testing/junit5/junit5bestpractices) - large changeset
   - [ ] [Static imports for AssertJ](https://docs.openrewrite.org/reference/recipes/java/testing/assertj/staticimports) - small changeset
   - [ ] [Migrate JUnit assertions to AssertJ](https://docs.openrewrite.org/reference/recipes/java/testing/assertj/junittoassertj) - large changeset
   - [ ] [src/main code cleanup recipes](https://docs.openrewrite.org/reference/recipes/java/cleanup/cleanup) - large changeset
   - [ ] [Logging best practices](https://docs.openrewrite.org/reference/recipes/java/logging) - large changeset
   - [ ] [Adopt Java 17 code patterns](https://docs.openrewrite.org/reference/recipes/java/migrate) - small changeset
   
   Typically the process is choosing a migration recipe, running a one-off command, visually inspecting the changes, running the tests and opening up a pull request.
   
   Personally I find these automated migrations fun to do, especially on larger code bases, but like I said: I don't want to overwhelm for at times small improvements. Any feedback on what types of changes would (not) be appreciated would help to ensure a positive experience for all. :)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@wicket.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [wicket] solomax commented on a diff in pull request #545: Cleanup JUnit 5 assertions

Posted by GitBox <gi...@apache.org>.
solomax commented on code in PR #545:
URL: https://github.com/apache/wicket/pull/545#discussion_r1001574012


##########
wicket-spring/src/test/java/org/apache/wicket/spring/FieldBeansCollectorTest.java:
##########
@@ -40,7 +40,7 @@ public void resolveGenericList() throws Exception
 
 		FieldBeansCollector fieldBeansCollector = new FieldBeansCollector(resolvableType);
 
-		assertTrue(fieldBeansCollector.getFieldType() == FieldType.LIST);
+		assertEquals(fieldBeansCollector.getFieldType(), FieldType.LIST);

Review Comment:
   arg positions also need to be be updated :)
   are there any tools to check such errors? :)
   
   `assertEquals(byte expected, byte actual, String message)`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@wicket.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org