116116
117117section " Triggers"
118118
119- # Create a trigger on diagnostic_bridge faults
119+ # Create a trigger on diagnostic-bridge faults
120120echo " Creating OnChange fault trigger..."
121- TRIGGER_RESPONSE=$( curl -s -w " \n%{http_code}" -X POST " ${API_BASE} /apps/diagnostic_bridge /triggers" \
121+ TRIGGER_RESPONSE=$( curl -s -w " \n%{http_code}" -X POST " ${API_BASE} /apps/diagnostic-bridge /triggers" \
122122 -H " Content-Type: application/json" \
123- -d ' {"resource":"/api/v1/apps/diagnostic_bridge /faults","trigger_condition":{"condition_type":"OnChange"},"multishot":true,"lifetime":60}' 2> /dev/null) || true
123+ -d ' {"resource":"/api/v1/apps/diagnostic-bridge /faults","trigger_condition":{"condition_type":"OnChange"},"multishot":true,"lifetime":60}' 2> /dev/null) || true
124124
125125TRIGGER_HTTP=$( echo " $TRIGGER_RESPONSE " | tail -1)
126126TRIGGER_BODY=$( echo " $TRIGGER_RESPONSE " | sed ' $d' )
127127
128128if [ " $TRIGGER_HTTP " = " 201" ]; then
129- pass " POST /apps/diagnostic_bridge /triggers returns 201"
129+ pass " POST /apps/diagnostic-bridge /triggers returns 201"
130130else
131- fail " POST /apps/diagnostic_bridge /triggers returns 201" " got HTTP $TRIGGER_HTTP "
131+ fail " POST /apps/diagnostic-bridge /triggers returns 201" " got HTTP $TRIGGER_HTTP "
132132fi
133133
134134TRIGGER_ID=$( echo " $TRIGGER_BODY " | jq -r ' .id' )
@@ -146,35 +146,35 @@ else
146146fi
147147
148148# List triggers - verify it appears
149- if api_get " /apps/diagnostic_bridge /triggers" ; then
149+ if api_get " /apps/diagnostic-bridge /triggers" ; then
150150 if echo " $RESPONSE " | jq -e --arg id " $TRIGGER_ID " ' .items[] | select(.id == $id)' > /dev/null 2>&1 ; then
151- pass " GET /apps/diagnostic_bridge /triggers lists created trigger"
151+ pass " GET /apps/diagnostic-bridge /triggers lists created trigger"
152152 else
153- fail " GET /apps/diagnostic_bridge /triggers lists created trigger" " trigger $TRIGGER_ID not found"
153+ fail " GET /apps/diagnostic-bridge /triggers lists created trigger" " trigger $TRIGGER_ID not found"
154154 fi
155155else
156- fail " GET /apps/diagnostic_bridge /triggers returns 200" " unexpected status code"
156+ fail " GET /apps/diagnostic-bridge /triggers returns 200" " unexpected status code"
157157fi
158158
159159# Delete trigger
160160TRIGGER_DELETE_STATUS=$( curl -s -o /dev/null -w " %{http_code}" -X DELETE \
161- " ${API_BASE} /apps/diagnostic_bridge /triggers/${TRIGGER_ID} " 2> /dev/null) || true
161+ " ${API_BASE} /apps/diagnostic-bridge /triggers/${TRIGGER_ID} " 2> /dev/null) || true
162162
163163if [ " $TRIGGER_DELETE_STATUS " = " 204" ]; then
164- pass " DELETE /apps/diagnostic_bridge /triggers/$TRIGGER_ID returns 204"
164+ pass " DELETE /apps/diagnostic-bridge /triggers/$TRIGGER_ID returns 204"
165165else
166- fail " DELETE /apps/diagnostic_bridge /triggers/$TRIGGER_ID returns 204" " got HTTP $TRIGGER_DELETE_STATUS "
166+ fail " DELETE /apps/diagnostic-bridge /triggers/$TRIGGER_ID returns 204" " got HTTP $TRIGGER_DELETE_STATUS "
167167fi
168168
169169# Verify trigger is gone
170- if api_get " /apps/diagnostic_bridge /triggers" ; then
170+ if api_get " /apps/diagnostic-bridge /triggers" ; then
171171 if ! echo " $RESPONSE " | jq -e --arg id " $TRIGGER_ID " ' .items[] | select(.id == $id)' > /dev/null 2>&1 ; then
172172 pass " trigger no longer listed after deletion"
173173 else
174174 fail " trigger no longer listed after deletion" " still found in list"
175175 fi
176176else
177- fail " GET /apps/diagnostic_bridge /triggers returns 200 after delete" " unexpected status code"
177+ fail " GET /apps/diagnostic-bridge /triggers returns 200 after delete" " unexpected status code"
178178fi
179179
180180# --- Summary ---
0 commit comments