AssertJ: assertThatCode() vs assertThatThrownBy()

76 Views Asked by At

What is the difference between assertThatCode(…).isInstanceOf(…) and assertThatThrownBy(…).isInstanceOf(…)?

Both seem to work the same, to the point where assertThatThrownBy() allows you to chain doesNotThrowAnyException() too (which is a bit funny).

0

There are 0 best solutions below