Hi,
I'm trying to create a couple end-to-end tests that take a hard-coded conversationId and then call /api/v2/conversations/{conversationId}. The response is the validated against our assertions. These conversationIds represent different scenarios and conversation types with attributes (phone calls, web messages, twoWayText/sms, etc). I would typically create a unit test that would validate a stubbed response, but I am trying go through the workflow of a couple micro-services.
I got done with a couple tests but recently rerunning them, it seems like the attributes are no longer on them. I ended up changing conversationIds to get me test working but then I began wondering about my approach. Not sure what has changed or why the attributes would be missing after a month, however it make wonder if there is a better way to handle these types of tests. I could write unit tests where I mock out the response from /api/v2/conversations, but since I am trying to test the behavior through a couple micro-services, can I rely on the response from /api/v2/conversations/{conversationId} to always return the same payload?
I have looked into programmatically creating a conversation (in this case, web chat), but I have struggled to format the query correctly using CreateWebChatConversationRequest
and PostWebchatGuestConversationsAsync
. Then again, I'm not sure if this is even an appropriate use of the system. If this is a recommended path, could you link me to any documentation that could help?
Thanks,