Added test coverage for querying metadata artifacts.

+review REVIEW-5282