Replies: 3 comments 11 replies
-
Hey @derberg, This is actually one complex question that lies in (my?) concerns about deciding what the AsyncAPI document point of view is. That said, Microcks supports both interpretations, and it's actually useful to have mock messages available on both types of endpoints - it's just useful from different perspectives. With my interpretation in mind, I drew this diagram a few years ago and it eventually help others to understand why we had mocks on both types of endpoints: ![]() Depending on the point of view you adopt:
To sum up, it's just a matter of perspective and you'll probably just pick one or another type of endpoint when you focus on one side of the API. Hope it helps! |
Beta Was this translation helpful? Give feedback.
-
well you know the spec is pretty clear about it 😉 Anyway, this is clear, so basically, mocks are produced for any type of operation. That's good to know. What I still do not understand is how to In one terminal window I start sending messages:
And in another start a test:
And what I see in the test result is that it is getting the mock messages that I'm obviously doing something wrong |
Beta Was this translation helpful? Give feedback.
-
No. During a test, Microcks connects to Let me check on my side to have a running sample. |
Beta Was this translation helpful? Give feedback.
-
This is my websocket document with one
send
and onereceive
operation.It is pretty easy for me to understand the
send
part. When I connect to generated endpointlocalhost:8081/api/ws/Hoppscotch+WebSocket+Server/1.0.0/sendTimeStampMessage
withwebsocat
I'm nicely receiving the example message:I'm having hard time with
receive
:localhost:8081/api/ws/Hoppscotch+WebSocket+Server/1.0.0/handleEchoMessage
My understanding is that this endpoint is only for receiving messages. That I can drop to it anything I want. But when I do
websocat ws://localhost:8081/api/ws/Hoppscotch+WebSocket+Server/1.0.0/handleEchoMessage
I'm also seeing example messages sent from server.This is what I also understood with https://microcks.io/documentation/guides/usage/async-protocols/avro-messaging/#without-schema-registry-1
I thought I can do below:
while true; do echo "hello" | websocat "ws://localhost:8081/api/ws/Hoppscotch+WebSocket+Server/1.0.0/handleEchoMessage"; sleep 1; done
hello
messages - but it is notSo if my reasoning is wrong - then how things work. What is the purpose of
RECEIVE
mock? test runs only validate examples - nothing elseNot sure if I explain myself well.
Beta Was this translation helpful? Give feedback.
All reactions