Make sure only one invocation in the assertThrows lambda can throw the...

Make sure only one invocation in the assertThrows lambda can throw the excepted exception. Code smell found by SonarQube.
1 job for code-smells in 9 minutes and 2 seconds (queued for 5 seconds)