[test] Adding tests against the middleware layers