package data_sender_go import ( "fmt" "loafle.com/overflow/agent_api/observer" "testing" "time" ) type Result struct { Data []byte } func TestSend(t *testing.T) { ds := &DataSender{} ds.Start() testNotify() time.Sleep(time.Second * 100) } func testNotify() { time.Sleep(time.Second * 5) result := make(map[string]string) result["ab"] = "123" result["cd"] = "456" result["ef"] = "789" cd := &Data{ SensorId: "insanity", Data: result, } fmt.Println("New data Notify") observer.Notify(observer.DATA_QUEUE.String(), cd) }