package ui import ( "cli-mon/yabl" "testing" "time" ) func TestNewAmqp(t *testing.T) { t.Run("Amqp Test", func(t *testing.T) { client := NewAmqp("amqp://user:password@localhost:5672/") if client == nil { t.Errorf("Can't create client") } client.Start() now := time.Now() field := yabl.FBoardReady action := yabl.PPuErrors tag := "localhost" event := &yabl.Event{ Tag: &tag, Field: &field, ActionName: &action, Object: nil, //unit: 3, Updated: &now, Value: yabl.ERROR, } client.Consume(event) event = &yabl.Event{ Tag: &tag, Field: &field, ActionName: &action, Object: nil, //unit: 3, Updated: &now, Value: nil, } client.Consume(event) client.Stop() }) }