summaryrefslogtreecommitdiff
path: root/test/tracetesting/payment/amex-credit-card-not-allowed.yaml
diff options
context:
space:
mode:
authorSaumit <justsaumit@protonmail.com>2025-09-27 02:14:26 +0530
committerSaumit <justsaumit@protonmail.com>2025-09-27 02:14:26 +0530
commit82e03978b89938219958032efb1448cc76baa181 (patch)
tree626f3e54d52ecd49be0ed3bee30abacc0453d081 /test/tracetesting/payment/amex-credit-card-not-allowed.yaml
Initial snapshot - OpenTelemetry demo 2.1.3 -f
Diffstat (limited to 'test/tracetesting/payment/amex-credit-card-not-allowed.yaml')
-rw-r--r--test/tracetesting/payment/amex-credit-card-not-allowed.yaml37
1 files changed, 37 insertions, 0 deletions
diff --git a/test/tracetesting/payment/amex-credit-card-not-allowed.yaml b/test/tracetesting/payment/amex-credit-card-not-allowed.yaml
new file mode 100644
index 0000000..6ad88e7
--- /dev/null
+++ b/test/tracetesting/payment/amex-credit-card-not-allowed.yaml
@@ -0,0 +1,37 @@
+# Copyright The OpenTelemetry Authors
+# SPDX-License-Identifier: Apache-2.0
+
+type: Test
+spec:
+ id: payment-amex-credit-card-not-allowed
+ name: 'Payment: Amex credit card not allowed'
+ description: Charge customer with an Amex credit card
+ trigger:
+ type: grpc
+ grpc:
+ protobufFile: ../../../pb/demo.proto
+ address: ${var:PAYMENT_ADDR}
+ method: oteldemo.PaymentService.Charge
+ request: |-
+ {
+ "amount": {
+ "currencyCode": "USD",
+ "units": 43,
+ "nanos": 130000000
+ },
+ "creditCard": {
+ "creditCardNumber": "3714 496353 98431",
+ "creditCardCvv": 672,
+ "creditCardExpirationYear": 2039,
+ "creditCardExpirationMonth": 1
+ }
+ }
+ specs:
+ - name: It should call Charge method and receive a gRPC error
+ selector: span[tracetest.span.type="rpc" name="grpc.oteldemo.PaymentService/Charge" rpc.system="grpc" rpc.method="Charge" rpc.service="oteldemo.PaymentService"]
+ assertions:
+ - attr:grpc.error_message = "Sorry, we cannot process amex credit cards. Only VISA or MasterCard is accepted."
+ - name: It should return a return an gRPC error code to the caller
+ selector: span[tracetest.span.type="general" name="Tracetest trigger"]
+ assertions:
+ - attr:tracetest.response.status = 2