JUnit 5 assertThrows: Verify Exceptions with a Simple Example
Learn how to use JUnit 5's assertThrows to verify exceptions, see a concrete code example, and avoid common pitfalls.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
Learn how to use JUnit 5's assertThrows to verify exceptions, see a concrete code example, and avoid common pitfalls.
I'm writing a script for PostgreSQL and since I want it to be executed atomically, I'm wrapping it inside a transaction. I expected the script to look something like this: BEGIN -- 1) Execute some valid actions; -- 2) Execute some action that causes an error. EXCEPTION WHEN OTHERS THEN ROLLBACK; END; -- A.k.a. COMMIT; However, in this case pgAdmin warns me a