I think you are just confused about the Cauchy-Goursat Theorem, it is a one sided implication which states that the integral of an analytic function over a closed contour is 0, but the converse is not generally true.
You actually don't need a simply connected region to apply Morera's Theorem...