A hiatal hernia may be diagnosed using one of two tests:  A barium x-ray. An endoscopy.