SCXML-284 Replace try-catch with assertThrows

Use JUnit Jupiter's new mechanism of assertThrows instead of try-catch
blocks in order to clean up the code and make it easier to follow.

Since the questionable piece of code is now run inside a lambda and is
caught by asserThrows itself, there's no need to declare these
exceptions in the throws clause of the mehod declarations, and they
were cleaned up to avoid adding compiler warnings.
9 files changed