The expected output URL evaluated by the load balancer containing the scheme, host, path and query parameters. For rules that forward requests to backends, the test passes only when expectedOutputUrl matches the request forwarded by the load balancer to backends. For rules with urlRewrite, the test verifies that the forwarded request matches hostRewrite and pathPrefixRewrite in the urlRewrite action. When service is specified, expectedOutputUrl`s scheme is ignored. For rules with urlRedirect, the test passes only if expectedOutputUrl matches the URL in the load balancer's redirect response. If urlRedirect specifies https_redirect, the test passes only if the scheme in expectedOutputUrl is also set to HTTPS. If urlRedirect specifies strip_query, the test passes only if expectedOutputUrl does not contain any query parameters. expectedOutputUrl is optional when service is specified.
public int ExpectedRedirectResponseCode { get; set; }
For rules with urlRedirect, the test passes only if expectedRedirectResponseCode matches the HTTP status code in load balancer's redirect response. expectedRedirectResponseCode cannot be set when service is set.
Expected BackendService or BackendBucket resource the given URL should be mapped to. The service field cannot be set if expectedRedirectResponseCode is set.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-03 UTC."],[[["\u003cp\u003eThe latest version of the \u003ccode\u003eUrlMapTest\u003c/code\u003e class in the Google Cloud Compute V1 API is 3.6.0, and documentation is available for versions ranging from 1.0.0 to 3.6.0.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eUrlMapTest\u003c/code\u003e is a class used for testing URL mappings within the Compute Engine v1 API, inheriting from \u003ccode\u003eobject\u003c/code\u003e and implementing interfaces such as \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, \u003ccode\u003eIDeepCloneable\u003c/code\u003e, and \u003ccode\u003eIBufferMessage\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eUrlMapTest\u003c/code\u003e class includes properties such as \u003ccode\u003eDescription\u003c/code\u003e, \u003ccode\u003eExpectedOutputUrl\u003c/code\u003e, \u003ccode\u003eExpectedRedirectResponseCode\u003c/code\u003e, \u003ccode\u003eHost\u003c/code\u003e, \u003ccode\u003ePath\u003c/code\u003e, \u003ccode\u003eService\u003c/code\u003e, and \u003ccode\u003eHeaders\u003c/code\u003e, allowing for configuration of test parameters.\u003c/p\u003e\n"],["\u003cp\u003eThe class has constructors to create new instances, including a default constructor and one that takes another \u003ccode\u003eUrlMapTest\u003c/code\u003e object as a parameter.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eUrlMapTest\u003c/code\u003e class's properties, such as \u003ccode\u003eExpectedOutputUrl\u003c/code\u003e and \u003ccode\u003eExpectedRedirectResponseCode\u003c/code\u003e, help to verify the forwarding, rewriting, or redirection of requests.\u003c/p\u003e\n"]]],[],null,["# Compute Engine v1 API - Class UrlMapTest (3.13.0)\n\nVersion latestkeyboard_arrow_down\n\n- [3.13.0 (latest)](/dotnet/docs/reference/Google.Cloud.Compute.V1/latest/Google.Cloud.Compute.V1.UrlMapTest)\n- [3.12.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/3.12.0/Google.Cloud.Compute.V1.UrlMapTest)\n- [3.11.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/3.11.0/Google.Cloud.Compute.V1.UrlMapTest)\n- [3.10.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/3.10.0/Google.Cloud.Compute.V1.UrlMapTest)\n- [3.9.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/3.9.0/Google.Cloud.Compute.V1.UrlMapTest)\n- [3.8.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/3.8.0/Google.Cloud.Compute.V1.UrlMapTest)\n- [3.7.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/3.7.0/Google.Cloud.Compute.V1.UrlMapTest)\n- [3.6.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/3.6.0/Google.Cloud.Compute.V1.UrlMapTest)\n- [3.5.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/3.5.0/Google.Cloud.Compute.V1.UrlMapTest)\n- [3.4.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/3.4.0/Google.Cloud.Compute.V1.UrlMapTest)\n- [3.3.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/3.3.0/Google.Cloud.Compute.V1.UrlMapTest)\n- [3.2.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/3.2.0/Google.Cloud.Compute.V1.UrlMapTest)\n- [3.1.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/3.1.0/Google.Cloud.Compute.V1.UrlMapTest)\n- [3.0.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/3.0.0/Google.Cloud.Compute.V1.UrlMapTest)\n- [2.17.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/2.17.0/Google.Cloud.Compute.V1.UrlMapTest)\n- [2.16.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/2.16.0/Google.Cloud.Compute.V1.UrlMapTest)\n- [2.15.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/2.15.0/Google.Cloud.Compute.V1.UrlMapTest)\n- [2.14.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/2.14.0/Google.Cloud.Compute.V1.UrlMapTest)\n- [2.13.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/2.13.0/Google.Cloud.Compute.V1.UrlMapTest)\n- [2.12.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/2.12.0/Google.Cloud.Compute.V1.UrlMapTest)\n- [2.11.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/2.11.0/Google.Cloud.Compute.V1.UrlMapTest)\n- [2.10.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/2.10.0/Google.Cloud.Compute.V1.UrlMapTest)\n- [2.9.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/2.9.0/Google.Cloud.Compute.V1.UrlMapTest)\n- [2.8.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/2.8.0/Google.Cloud.Compute.V1.UrlMapTest)\n- [2.7.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/2.7.0/Google.Cloud.Compute.V1.UrlMapTest)\n- [2.6.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/2.6.0/Google.Cloud.Compute.V1.UrlMapTest)\n- [2.5.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/2.5.0/Google.Cloud.Compute.V1.UrlMapTest)\n- [2.4.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/2.4.0/Google.Cloud.Compute.V1.UrlMapTest)\n- [2.3.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/2.3.0/Google.Cloud.Compute.V1.UrlMapTest)\n- [2.2.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/2.2.0/Google.Cloud.Compute.V1.UrlMapTest)\n- [2.1.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/2.1.0/Google.Cloud.Compute.V1.UrlMapTest)\n- [2.0.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/2.0.0/Google.Cloud.Compute.V1.UrlMapTest)\n- [1.4.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/1.4.0/Google.Cloud.Compute.V1.UrlMapTest)\n- [1.3.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/1.3.0/Google.Cloud.Compute.V1.UrlMapTest)\n- [1.2.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/1.2.0/Google.Cloud.Compute.V1.UrlMapTest)\n- [1.1.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/1.1.0/Google.Cloud.Compute.V1.UrlMapTest)\n- [1.0.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/1.0.0/Google.Cloud.Compute.V1.UrlMapTest) \n\n public sealed class UrlMapTest : IMessage\u003cUrlMapTest\u003e, IEquatable\u003cUrlMapTest\u003e, IDeepCloneable\u003cUrlMapTest\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Compute Engine v1 API class UrlMapTest.\n\nMessage for the expected URL mappings. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e UrlMapTest \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[UrlMapTest](/dotnet/docs/reference/Google.Cloud.Compute.V1/latest/Google.Cloud.Compute.V1.UrlMapTest), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[UrlMapTest](/dotnet/docs/reference/Google.Cloud.Compute.V1/latest/Google.Cloud.Compute.V1.UrlMapTest), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[UrlMapTest](/dotnet/docs/reference/Google.Cloud.Compute.V1/latest/Google.Cloud.Compute.V1.UrlMapTest), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html) \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Cloud.Compute.V1](/dotnet/docs/reference/Google.Cloud.Compute.V1/latest/Google.Cloud.Compute.V1)\n\nAssembly\n--------\n\nGoogle.Cloud.Compute.V1.dll\n\nConstructors\n------------\n\n### UrlMapTest()\n\n public UrlMapTest()\n\n### UrlMapTest(UrlMapTest)\n\n public UrlMapTest(UrlMapTest other)\n\nProperties\n----------\n\n### Description\n\n public string Description { get; set; }\n\nDescription of this test case.\n\n### ExpectedOutputUrl\n\n public string ExpectedOutputUrl { get; set; }\n\nThe expected output URL evaluated by the load balancer containing the scheme, host, path and query parameters. For rules that forward requests to backends, the test passes only when expectedOutputUrl matches the request forwarded by the load balancer to backends. For rules with urlRewrite, the test verifies that the forwarded request matches hostRewrite and pathPrefixRewrite in the urlRewrite action. When service is specified, expectedOutputUrl\\`s scheme is ignored. For rules with urlRedirect, the test passes only if expectedOutputUrl matches the URL in the load balancer's redirect response. If urlRedirect specifies https_redirect, the test passes only if the scheme in expectedOutputUrl is also set to HTTPS. If urlRedirect specifies strip_query, the test passes only if expectedOutputUrl does not contain any query parameters. expectedOutputUrl is optional when service is specified.\n\n### ExpectedRedirectResponseCode\n\n public int ExpectedRedirectResponseCode { get; set; }\n\nFor rules with urlRedirect, the test passes only if expectedRedirectResponseCode matches the HTTP status code in load balancer's redirect response. expectedRedirectResponseCode cannot be set when service is set.\n\n### HasDescription\n\n public bool HasDescription { get; }\n\nGets whether the \"description\" field is set\n\n### HasExpectedOutputUrl\n\n public bool HasExpectedOutputUrl { get; }\n\nGets whether the \"expected_output_url\" field is set\n\n### HasExpectedRedirectResponseCode\n\n public bool HasExpectedRedirectResponseCode { get; }\n\nGets whether the \"expected_redirect_response_code\" field is set\n\n### HasHost\n\n public bool HasHost { get; }\n\nGets whether the \"host\" field is set\n\n### HasPath\n\n public bool HasPath { get; }\n\nGets whether the \"path\" field is set\n\n### HasService\n\n public bool HasService { get; }\n\nGets whether the \"service\" field is set\n\n### Headers\n\n public RepeatedField\u003cUrlMapTestHeader\u003e Headers { get; }\n\nHTTP headers for this request. If headers contains a host header, then host must also match the header value.\n\n### Host\n\n public string Host { get; set; }\n\nHost portion of the URL. If headers contains a host header, then host must also match the header value.\n\n### Path\n\n public string Path { get; set; }\n\nPath portion of the URL.\n\n### Service\n\n public string Service { get; set; }\n\nExpected BackendService or BackendBucket resource the given URL should be mapped to. The service field cannot be set if expectedRedirectResponseCode is set."]]