Use @ShouldThrowException(Exception.class) instead of DefinitionException.class