Tests[TestSendSimpleMessageJSON]

This commit is contained in:
2022-11-30 17:58:04 +01:00
parent 0ff1188c3d
commit 62d7df9710
14 changed files with 496 additions and 188 deletions

View File

@@ -13,13 +13,17 @@ type SinkData struct {
}
type TestSink struct {
data []SinkData
Data []SinkData
}
func NewTestSink() NotificationClient {
return &TestSink{}
}
func (d *TestSink) Last() SinkData {
return d.Data[len(d.Data)-1]
}
func (d *TestSink) SendNotification(ctx context.Context, client models.Client, msg models.Message) (string, error) {
id, err := langext.NewHexUUID()
if err != nil {
@@ -28,7 +32,7 @@ func (d *TestSink) SendNotification(ctx context.Context, client models.Client, m
key := "TestSink[" + id + "]"
d.data = append(d.data, SinkData{
d.Data = append(d.Data, SinkData{
Message: msg,
Client: client,
})