Maybe use the `ExpectedException` JUnit 4 rule for this, this may be a bit shorter?