code: def test_validate_should_fail_when_value_does_not_match_regex(self):
      specification = [
          dict(
              name="an_union",
              type="union",
              fields=[
                  dict(name="variant_1", regexp=r"[^a-z]"),
              ],
          )
      ]
      body = {"variant_1": "abc"}
  
      validator = GcpBodyFieldValidator(specification, "v1")
      with pytest.raises(GcpFieldValidationException):
          validator.validate(body)
  
imports: from __future__ import annotations
  import pytest
  from airflow.providers.google.cloud.utils.field_validator import GcpBodyFieldValidator, GcpFieldValidationException, GcpValidationSpecificationException
label_desc: Use image node_id 24 for calling the TestGcpBodyFieldValidator obj's underlying member method code with example usage: obj.test_validate_should_fail_when_value_does_not_match_regex() without return types