overflow_probe/discovery/communicate/communicator_test.go
2017-08-04 11:32:31 +09:00

27 lines
636 B
Go

package communicate
import (
"bytes"
"encoding/json"
"git.loafle.net/overflow/overflow_probe/central/client/events"
"git.loafle.net/overflow/overflow_probe/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))
}