Add middleware tests

this user is not used in test. Missing tests ?