func newHeartbeatRequest() *control.ControlMessage {
	id, _ := uuid.NewV4()

	return &control.ControlMessage{
		Origin:      proto.String("MET"),
		Identifier:  factories.NewControlUUID(id),
		Timestamp:   proto.Int64(time.Now().UnixNano()),
		ControlType: control.ControlMessage_HeartbeatRequest.Enum(),
	}
}
func newMarshalledHeartbeatRequest() []byte {
	id, _ := uuid.NewV4()

	heartbeatRequest := &control.ControlMessage{
		Origin:      proto.String("test"),
		Identifier:  factories.NewControlUUID(id),
		Timestamp:   proto.Int64(time.Now().UnixNano()),
		ControlType: control.ControlMessage_HeartbeatRequest.Enum(),
	}

	bytes, err := proto.Marshal(heartbeatRequest)
	if err != nil {
		panic(err.Error())
	}
	return bytes
}
		})

		It("delegates to the wrapped emitter", func() {
			heartbeatResponder.Emit(testData)

			messages := wrappedEmitter.GetMessages()
			Expect(messages).To(HaveLen(1))
			Expect(messages[0]).To(Equal(testData))
		})

		It("increments the heartbeat counter", func() {
			id, _ := uuid.NewV4()

			heartbeatRequest := &control.ControlMessage{
				Origin:      proto.String("test"),
				Identifier:  factories.NewControlUUID(id),
				Timestamp:   proto.Int64(time.Now().UnixNano()),
				ControlType: control.ControlMessage_HeartbeatRequest.Enum(),
			}
			heartbeatResponder.Emit(testData)
			heartbeatResponder.Respond(heartbeatRequest)

			Eventually(wrappedEmitter.GetMessages).Should(HaveLen(2))

			message := wrappedEmitter.GetMessages()[1]
			hbEnvelope := &events.Envelope{}
			err := proto.Unmarshal(message, hbEnvelope)
			Expect(err).NotTo(HaveOccurred())

			hbEvent := hbEnvelope.GetHeartbeat()