Testing frameworks: Is Google Truth a substitute for JUnit? How to I write test methods and test suites?
Asked Answered
M

1

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!

Majuscule answered 22/1, 2017 at 4:10 Comment(0)
L
16

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.

Lathery answered 22/1, 2017 at 8:27 Comment(1)
Awesome. Thanks ralph!Majuscule

© 2022 - 2024 — McMap. All rights reserved.