fix(studio): make message provider fail explicitly instead of returning empty stub results - #751
Conversation
…ng empty stub results MessageProviderStub was wired as the production MessageProvider but returned an empty list from queryMessages and an empty trace from getMessageTrace, which could mislead operators into thinking no message or trace exists. Until a real message provider is connected, both operations now fail explicitly with a structured 501 Not Implemented BusinessException. Added MessageProviderStubTest for the new behavior. Fixes apache#684
|
Thanks for the contribution. This is already covered by #685, merged into Two details from your version were not carried over, and a small follow-up PR would be welcome if you think they are worth it: per-method messages ( |
Fixes #684
Problem
MessageProviderStubis wired as the productionMessageProvider, butqueryMessagesreturns an empty list andgetMessageTracereturns an empty trace. A successful empty response can mislead operators into thinking no message or trace exists, when in fact no real provider is connected.Fix
Until a real message provider is connected, both operations now fail explicitly with a structured
501 Not ImplementedBusinessException(mapped byGlobalExceptionHandlerto a cleanResult.error(501, ...)), matching the issue's expected behavior. AddedMessageProviderStubTest.Verification
mvn test -Dtest=MessageProviderStubTeston JDK 21:Tests run: 2, Failures: 0, Errors: 0, Skipped: 0.Diff
2 files changed, +56 / -10.