-
Notifications
You must be signed in to change notification settings - Fork 8
/
connector_test.go
45 lines (37 loc) · 1.06 KB
/
connector_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package connector_test
import (
"context"
"testing"
"time"
"github.com/luno/workflow"
"github.com/luno/workflow/adapters/memrecordstore"
"github.com/luno/workflow/adapters/memrolescheduler"
"github.com/luno/workflow/adapters/memstreamer"
"github.com/luno/workflow/adapters/memtimeoutstore"
"github.com/luno/workflow/_examples/connector"
)
func TestConnectStreamParallelConsumer(t *testing.T) {
foreignID := "andrewwormald"
now := time.Date(2024, time.April, 9, 0, 0, 0, 0, time.UTC)
events := []workflow.ConnectorEvent{
{
ID: "1",
ForeignID: foreignID,
CreatedAt: now,
},
}
w := connector.Workflow(connector.Deps{
EventStreamer: memstreamer.New(),
RecordStore: memrecordstore.New(),
TimeoutStore: memtimeoutstore.New(),
RoleScheduler: memrolescheduler.New(),
Connector: memstreamer.NewConnector(events),
})
ctx := context.Background()
w.Run(ctx)
t.Cleanup(w.Stop)
workflow.Require(t, w, foreignID, connector.StatusFollowedTheExample, connector.GettingStarted{
ReadTheDocs: "✅",
FollowAnExample: "✅",
})
}