If the cleric is casting a spell to test whether or not it is a mimic, then I think the cleric has noticed a threat, by definition.
As a player, if my character is sufficiently aware of a specific threat to be taking specific precautions, I would not consider it to be a fair use of the surprise...