10

I came across Google Truth https://google.github.io/truth/ and thought to try it out. I read the information on that site but still have a basic question.

Is Truth a substitute for JUnit? How should I write the @test methods and test suites the way I write in JUnit and automate the test execution say through Jenkins? Or is it that Truth is just about making your assertion code beautiful and everything else stays the same?

Does Truth still needs help of JUnit framework (or something like JUnit)?

Thanks!

1 Answer 1

14

No, Google Truth isn't a full replacement for JUnit/TestNG. Truth is an assertion framework which allows you to write assertions more flexibly (see their Comparison page for details).

Truth however doesn't have a concept of tests/test suites/test runs/... so you'll still need a testing framework (like JUnit or TestNG) to actually execute your tests.

1
  • 1
    Awesome. Thanks ralph! Jan 22, 2017 at 8:34

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.