wmStartReceiver starts a goroutine that receives messages from a channel Returns a pointer to track the received count
(t *testing.T, receiveChan <-chan *Message, expectBucket, expectKey string, received *int, wg *sync.WaitGroup)
| 189 | // wmStartReceiver starts a goroutine that receives messages from a channel |
| 190 | // Returns a pointer to track the received count |
| 191 | func wmStartReceiver(t *testing.T, receiveChan <-chan *Message, expectBucket, expectKey string, received *int, wg *sync.WaitGroup) { |
| 192 | wg.Add(1) |
| 193 | go func() { |
| 194 | defer wg.Done() |
| 195 | for msg := range receiveChan { |
| 196 | assert.Equal(t, expectBucket, msg.BucketName) |
| 197 | assert.Equal(t, expectKey, msg.Key) |
| 198 | assert.NotNil(t, msg.Value) |
| 199 | assert.Equal(t, DataSetFlag, msg.Flag) |
| 200 | *received++ |
| 201 | } |
| 202 | }() |
| 203 | } |
| 204 | |
| 205 | func TestWatchManager_SubscribeAndSendMessage(t *testing.T) { |
| 206 | t.Run("subscribe and send message", func(t *testing.T) { |
no test coverage detected