add middleware chain tests