Factor the dispatcher tests to be easier to read and maintain
Factor the dispatcher tests to be easier to read and maintain

Signed-off-by: Ying Li <f39392f1e2d21dabc2bc5ab11d2bf832bde87b60@docker.com>

alyyousuf7/swarmkit,jlhawn/swarmkit,cheyang/swarmkit,sungwonh/swarmkit,dperny/swarmkit-1,cheyang/swarmkit,dperny/swarmkit-1,alyyousuf7/swarmkit,jlhawn/swarmkit,sungwonh/swarmkit,AliyunContainerService/swarmkit,AliyunContainerService/swarmkit,docker/swarmkit,docker/swarmkit