Implemented test_dispatchermiddleware