change test code patterns to annotations
In a number of client-interface tests we have particular patterns in the code that we then recognize in the client to let us know when to perform certain actions. Now that we have annotation support we should rewrite the tests to use annotations. This will make them more robust, as the patterns are not foolproof: for a recent example, xref #2237 (closed).