discovery/communicate/communicator_test.go
2017-06-26 19:10:52 +09:00

27 lines
606 B
Go

package communicate
import (
"bytes"
"encoding/json"
"git.loafle.net/overflow/central/client/events"
"git.loafle.net/overflow/discovery/discovery/types/timestamp"
"net/http"
"testing"
)
func TestEventCollector(t *testing.T) {
ev := events.Event{}
ev.EventType = "install"
ev.Time = timestamp.Now()
ev.Collector_id = "1111111"
ev.Data = events.CollectorInstallEvent{Version: "2.2"}
bb, _ := json.Marshal(ev)
//com := CompressTest(CompressDataGzip, UnCompressDataGzip, bb)
http.Post("http://localhost:9090/_api/collector/event/status/install", "application/json", bytes.NewBuffer(bb))
}