Refactored  QueryOperationSpec tests