+# API Test function: GET /ei-producer/v1/eiproducers/{eiProducerId}/eijobs
+# args: (V1-2) <response-code> <producer-id> (EMPTY | [<job-id> <type-id> <target-url> <job-owner> <template-job-file>]+)
+# (Function for test scripts)
+ecs_api_edp_get_producer_jobs_2() {
+ __log_test_start $@
+
+ #Valid number of parameter 2,3,7,11
+ paramError=1
+ if [ $# -eq 2 ]; then
+ paramError=0
+ fi
+ if [ $# -eq 3 ] && [ "$3" == "EMPTY" ]; then
+ paramError=0
+ fi
+ variablecount=$(($#-2))
+ if [ $# -gt 3 ] && [ $(($variablecount%5)) -eq 0 ]; then
+ paramError=0
+ fi
+ if [ $paramError -eq 1 ]; then
+ __print_err "<response-code> <producer-id> (EMPTY | [<job-id> <type-id> <target-url> <job-owner> <template-job-file>]+)" $@
+ return 1
+ fi
+
+ query="/ei-producer/v1/eiproducers/$2/eijobs"
+ res="$(__do_curl_to_api ECS GET $query)"
+ status=${res:${#res}-3}
+ if [ $status -ne $1 ]; then
+ __log_test_fail_status_code $1 $status
+ return 1
+ fi
+ if [ $# -gt 2 ]; then
+ body=${res:0:${#res}-3}
+ targetJson="["
+ if [ $# -gt 3 ]; then
+ arr=(${@:3})
+ for ((i=0; i<$(($#-3)); i=i+5)); do
+ if [ "$targetJson" != "[" ]; then
+ targetJson=$targetJson","
+ fi
+ if [ -f ${arr[$i+4]} ]; then
+ jobfile=$(cat ${arr[$i+4]})
+ jobfile=$(echo "$jobfile" | sed "s/XXXX/${arr[$i]}/g")
+ else
+ _log_test_fail_general "Job template file "${arr[$i+4]}", does not exist"
+ return 1
+ fi
+ targetJson=$targetJson"{\"ei_job_identity\":\"${arr[$i]}\",\"ei_type_identity\":\"${arr[$i+1]}\",\"target_uri\":\"${arr[$i+2]}\",\"owner\":\"${arr[$i+3]}\",\"ei_job_data\":$jobfile, \"last_updated\":\"????\"}"
+ done
+ fi
+ targetJson=$targetJson"]"
+
+ echo " TARGET JSON: $targetJson" >> $HTTPLOG
+ res=$(python3 ../common/compare_json.py "$targetJson" "$body")
+
+ if [ $res -ne 0 ]; then
+ __log_test_fail_body
+ return 1
+ fi
+ fi
+
+ __log_test_pass
+ return 0
+}