Add middleware tests.