-1

I am doing unit tests in Java with Mockito and PowerMock, I would like to know if there is any way to make a assert but in such a way that it only shows me a warning but does not influence like a failure in running the tests.

Makoto
  • 104,088
  • 27
  • 192
  • 230

1 Answers1

2

Assertion is boolean; it either is or isn't true. JUnit interprets a failing condition as failure, and this is not a thing that is configured to change.

Ultimately, you're going to want to think about what you're testing. If you're attempting to test the validity of something, then assertion and dealing with the failing test is the right way to go about it. If you only want to smoke test, then don't assert anything, although I must strongly discourage you from doing this since the value of the unit test is removed in that scheme.

Makoto
  • 104,088
  • 27
  • 192
  • 230