Refs #17059; added tests covering the logic of relations macro