// PublishSimpleMessage publises a message on a pubnub channel and // calls the parse method to validate the message subscription. func PublishSimpleMessage(pubnubInstance *pubnubMessaging.Pubnub, t *testing.T, channel string, testName string, cipherKey string) { message := "Test message" returnChannel := make(chan []byte) go pubnubInstance.Publish(channel, message, returnChannel) ParseSubscribeResponse(pubnubInstance, returnChannel, t, channel, "", testName, cipherKey) }
// PublishComplexMessage publises a complex message on a pubnub channel and // calls the parse method to validate the message subscription. // CustomComplexMessage and InitComplexMessage are defined in the common.go file. func PublishComplexMessage(pubnubInstance *pubnubMessaging.Pubnub, t *testing.T, channel string, testName string, cipherKey string) { customComplexMessage := InitComplexMessage() returnChannel := make(chan []byte) go pubnubInstance.Publish(channel, customComplexMessage, returnChannel) ParseSubscribeResponse(pubnubInstance, returnChannel, t, channel, "", testName, cipherKey) }