Add test integrated with middleware