Repository navigation
Closed
Description
From looking at the tests across this repo @ 6753d9c, it looks like junit is the defacto test runner:
$ git grep testCompile
_template/build.gradle: testCompile "junit:junit:4.10"
accumulate/build.gradle: testCompile "junit:junit:4.10"
allergies/build.gradle: testCompile "junit:junit:4.10"
anagram/build.gradle: testCompile "junit:junit:4.10"
atbash-cipher/build.gradle: testCompile "junit:junit:4.10"
binary/build.gradle: testCompile "junit:junit:4.10"
bob/build.gradle: testCompile "junit:junit:4.10"
crypto-square/build.gradle: testCompile "junit:junit:4.10"
etl/build.gradle: testCompile "junit:junit:4.10"
etl/build.gradle: testCompile "org.easytesting:fest-assert-core:2.0M10"
etl/build.gradle: testCompile "com.google.guava:guava:16+"
gigasecond/build.gradle: testCompile "junit:junit:4.10"
grade-school/build.gradle: testCompile "junit:junit:4.10"
grade-school/build.gradle: testCompile "org.easytesting:fest-assert-core:2.0M10"
hamming/build.gradle: testCompile "junit:junit:4.10"
hello-world/build.gradle: testCompile "junit:junit:4.10"
luhn/build.gradle: testCompile "junit:junit:4.10"
meetup/build.gradle: testCompile "junit:junit:4.10"
meetup/build.gradle: testCompile "org.easytesting:fest-assert-core:2.0M10"
nucleotide-count/build.gradle: testCompile "junit:junit:4.10"
nucleotide-count/build.gradle: testCompile "org.easytesting:fest-assert-core:2.0M10"
octal/build.gradle: testCompile "junit:junit:4.10"
pangram/build.gradle: testCompile "junit:junit:4.10"
pascals-triangle/build.gradle: testCompile "junit:junit:4.10"
phone-number/build.gradle: testCompile "junit:junit:4.10"
pig-latin/build.gradle: testCompile "junit:junit:4.10"
prime-factors/build.gradle: testCompile "junit:junit:4.12"
raindrops/build.gradle: testCompile "junit:junit:4.10"
rna-transcription/build.gradle: testCompile "junit:junit:4.10"
robot-name/build.gradle: testCompile "junit:junit:4.10"
roman-numerals/build.gradle: testCompile "junit:junit:4.10"
scrabble-score/build.gradle: testCompile "junit:junit:4.10"
sieve/build.gradle: testCompile "junit:junit:4.10"
simple-cipher/build.gradle: testCompile "junit:junit:4.10"
space-age/build.gradle: testCompile "junit:junit:4.10"
strain/build.gradle: testCompile "junit:junit:4.10"
triangle/build.gradle: testCompile "junit:junit:4.10"
trinary/build.gradle: testCompile "junit:junit:4.10"
word-count/build.gradle: testCompile "junit:junit:4.10"
We're not consistent on which assertion methods to use. Some tests use either junit's assertEquals(), others use junit's assertThat() or fest-assert's assertThat().
- Should we pick one version of
junitand use that across the board? - Should we pick one assertion API and stick with it? Note that fest-assert seems to be replaced by AssertJ (FWIW).
The latest version of junit in maven central is 4.12, so I'd vote for that.
I'm partial to variations of assertThat() because of matcher support (for Collection classes, arrays, etc). But I don't have a strong opinion aside from that.
Metadata
Metadata
Assignees
Labels
No labels
Activity
sit commentedon Dec 24, 2015
Good idea. Put up a PR that uses junit 4.12 and converts existing fest asserts to assertj.
jtigger commentedon Dec 25, 2015
Thanks for calling this our @winterchord.
@sit's PR was spot on.
JUnit is still the de facto testing framework in Java (not to spark a religious war with TestNG supporters); with JUnit Lambda getting legs (full disclosure: I work for Pivotal), the long-overdue overhaul is underway.
AssertJ is the most feature reach and fluent assertion framework in Java I'm aware of; great pick.