There's actually a third way, at least for low ranks
My sensei, for our first exam, "announced an unannounced" exam: he said we will act as in test for the next 4 lessons, but didn't reveal which one was the real exam... maybe all of them where, maybe only the one where a godan friend of him came to watch... who knows?
Personally, my only concerns about surprise is the name of the techniques, which I still find difficult to master in all the variants I've trained in at this stage and surely need a special rethinking the day before the exam... but I don't think a few day of pre-advice may change a year of practice, so by a technical standpoint I think surprise or not, you'll do on the mat exactly the same stuff.
Bye!