Marke,
What you said about 'no flow, no work' is certainly true, and a pump working against a shut off valve is, in fact only circulating fluid in the pump housing, but that is not cavitation.
Cavitation, and there are lots of threads in other places in this forum, is a condition of flow, not the lack thereof.
Rodmcm is correct in his assumption that discharge head is produced against the shut off valve. It is called 'shut off pressure' in pump parlance. And, if left in that condition too long, the electrical work done on the pump at no flow will just heat up the fluid in the pump, and in the case of water, will after a finite time, boil or flash it, vapor locking the pump. While often confused with cavitation, it is not that.
A pump always draws some horsepower, if no more than just to overcome bearing and seal friction. It draws the least amount of horsepower possible at 'shut off', and the most horsepower at wide open flow.
Apart from water hammer , which is an problem in and of itself, getting to the point at which the hammer occurs, or filling an empty pipe to the point of hammer, is a wide open flow situation, and the pump is requiring maximum HP from the motor, all while the motor is trying to start and come to speed. It is the worst of all worlds, hence, the procedure of shutting the discharge valve to start the pump.
rmw