-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Migrate all tests to Truth & use assertThrows
#2687
Migrate all tests to Truth & use assertThrows
#2687
Conversation
gson/src/test/java/com/google/gson/functional/PrimitiveTest.java
Outdated
Show resolved
Hide resolved
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.
This is fantastic! Thanks for the many small improvements throughout, beyond just the mechanical transformation into assertThat
and assertThrows
.
Just a couple of very minor things.
gson/src/test/java/com/google/gson/functional/PrimitiveTest.java
Outdated
Show resolved
Hide resolved
Because there is only `Gson.toJson(Object)` (and no primitive specific overloads) the tests were previously testing the adapter for the boxed object, e.g. Double, twice.
Sorry for the delay; I have added a few more test improvements. This pull request should now be ready. |
This works because unlike the main sources the tests are compiled with Java 11.
Purpose
Migrate all tests to Truth & use
assertThrows
Description
try { ...; fail(); } catch (expected) { }
toassertThrows
Checklist
This is automatically checked by
mvn verify
, but can also be checked on its own usingmvn spotless:check
.Style violations can be fixed using
mvn spotless:apply
; this can be done in a separate commit to verify that it did not cause undesired changes.null
@since $next-version$
(
$next-version$
is a special placeholder which is automatically replaced during release)TestCase
)mvn clean verify javadoc:jar
passes without errors