Add middleware tests

?