Skip to content

Add emulator handler for SetBackendService#224

Open
Mielek wants to merge 2 commits into
Azure:mainfrom
Mielek:emulator/set-backend-service
Open

Add emulator handler for SetBackendService#224
Mielek wants to merge 2 commits into
Azure:mainfrom
Mielek:emulator/set-backend-service

Conversation

@Mielek
Copy link
Copy Markdown
Contributor

@Mielek Mielek commented Feb 26, 2026

Summary

Implement SetBackendServiceHandler with base-url and backend-id support matching gateway behavior.

Gateway behavior

  • base-url mode: Changes the backend service URL (Api.ServiceUrl) by parsing the provided URL
  • backend-id mode: In gateway, looks up a backend entity from registry. In emulator, stores the backend ID in context.Variables["backendId"] for test assertions

Changes

  • Modified: handler (was stub throwing NotImplementedException)
  • New: 6 test cases covering all 4 sections, backend-id, and callback

169 tests pass, 0 regressions.

- Implement SetBackendServiceHandler with base-url and backend-id modes
- base-url mode: parses URL and sets Api.ServiceUrl
- backend-id mode: resolves from BackendStore, throws BadRuntimeConfigurationException if not found
- Add BackendStore for registering mock backends via SetupBackendStore()
- Add Backend record (Id, Url)
- Add BadRuntimeConfigurationException for configuration errors
- Add SetBackendServiceTests with 7 test cases
- Sections: Inbound, Backend, Outbound, OnError

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@Mielek Mielek force-pushed the emulator/set-backend-service branch from bf93a5d to b519449 Compare February 26, 2026 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants