summaryrefslogtreecommitdiffstats
path: root/cds-regression-test/test/resource-resolution/success/test.sh
diff options
context:
space:
mode:
Diffstat (limited to 'cds-regression-test/test/resource-resolution/success/test.sh')
-rwxr-xr-xcds-regression-test/test/resource-resolution/success/test.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/cds-regression-test/test/resource-resolution/success/test.sh b/cds-regression-test/test/resource-resolution/success/test.sh
new file mode 100755
index 0000000..c43c276
--- /dev/null
+++ b/cds-regression-test/test/resource-resolution/success/test.sh
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+CBA_NAME="resource-resolution"
+TEST_NAME="success"
+TEST_NUMBER=$RANDOM
+
+REQUEST_PAYLOAD_DIR="request-payloads"
+EXPECTED_PAYLOAD_DIR="expected-payloads"
+
+mkdir -p "$RESPONSES_DIRECTORY/$CBA_NAME/$TEST_NAME/$TEST_NUMBER/"
+RESPONSE_HEADERS_FILE="$RESPONSES_DIRECTORY/$CBA_NAME/$TEST_NAME/$TEST_NUMBER/response-headers"
+RESPONSE_PAYLOAD_FILE="$RESPONSES_DIRECTORY/$CBA_NAME/$TEST_NAME/$TEST_NUMBER/response-payload"
+REQUEST_PAYLOAD_FILE="$TEST_DIRECTORY/$CBA_NAME/$TEST_NAME/$REQUEST_PAYLOAD_DIR/request-payload.json"
+EXPECTED_PAYLOAD_FILE="$TEST_DIRECTORY/$CBA_NAME/$TEST_NAME/$EXPECTED_PAYLOAD_DIR/expected-response.json"
+
+. ./$TEST_DIRECTORY/utils.sh
+
+echo "Running test: $CBA_NAME:$TEST_NUMBER:$TEST_NAME"
+process_cba $REQUEST_PAYLOAD_FILE $RESPONSE_PAYLOAD_FILE $RESPONSE_HEADERS_FILE
+
+echo 'Assert statuscode'
+assert_status_code 200 $RESPONSE_HEADERS_FILE
+
+echo 'Assert payload'
+assert_cds_response_equals $EXPECTED_PAYLOAD_FILE $RESPONSE_PAYLOAD_FILE