1

I'm new to JUnit testing. I've tried using conditions, but it doesn't seem to work using assertEquals. For example, assertEquals(1 > 0, 10) which gives me a failed test. Is there another way of doing it? Thanks.

1 Answers1

4

Use assertTrue, in your case: assertTrue(x > 0).

You can find all provided assertion-types here.

Moritz Groß
  • 1,352
  • 12
  • 30