Adjust tests to verify middleware() with hierarchical resources samples.