Assert id == resourceId where possible.