getMsgContentAsJSONObject is a test helper that fails the rest if the message content is not a map[string]interface{} and returns the content as a map[string]interface{} if it is of the correct type.
(t *testing.T, msg ComposedMsg)
| 552 | // getMsgContentAsJSONObject is a test helper that fails the rest if the message content is not a |
| 553 | // map[string]interface{} and returns the content as a map[string]interface{} if it is of the correct type. |
| 554 | func getMsgContentAsJSONObject(t *testing.T, msg ComposedMsg) map[string]interface{} { |
| 555 | t.Helper() |
| 556 | |
| 557 | content, ok := msg.Content.(map[string]interface{}) |
| 558 | if !ok { |
| 559 | t.Fatalf("\t%s Message content is not a JSON object", failure) |
| 560 | } |
| 561 | |
| 562 | return content |
| 563 | } |
| 564 | |
| 565 | // getString is a test helper that retrieves a value as a string from the content at the given key. If the key |
| 566 | // does not exist in the content map or the value is not a string this will fail the test. The jsonObjectName |
no outgoing calls
no test coverage detected