GCP-6092 middleware method and junit test