In the different dojos I've trained, different affiliations/styles, your ukes when up for rank were at least peers and usually seniors.
And Carsten replied: Up to what rank? If a shodan really can throw a nidan: Why is he nidan??? What makes him or her nidan, if he or she can be thrown by a shodan?
It can take a more advanced student to offer the best attack for a given test-taker, first in terms of providing appropriate speed, committment, etc and second in terms of knowing and understanding the junior therefore providing an appropriate amount of pressure for the test.
This assumes the role of uke is not to lock out or resist technique but to provide an appropriate challenge.
Occasionally, in a competitive situation (and we're usually NOT competing in Aikido) a lower ranked person will defeat/throw/hit (whatever) - the greater the spread in rank, the less frequent this will be - for example - once, when a gokyu, training with a judo godan (and Olympic silver medal winner) - I managed to "get" him with a tsuri--komi-goshi. Surprised the heck out of both of us, he laughed all the way to the mat, got up, and continued giving me lots of flight time as he was doing prior to my surprise move.
If in an aikido practice or grading session a senior person is blocking my movements with the aim of being a "dick" I won't practice with him/her - not in judo any more, not competing, too old for that "stuff". If that person is showing me a weakness and then suggests where I should change, either he/she has learned by finding the weakness and helping me improved or I have learned from the experience, or both...
Anyway - tests are different again.