Skip to content

Commit

Permalink
update polling builder to use DataDestination/StatusReporter
Browse files Browse the repository at this point in the history
  • Loading branch information
cwaldren-ld committed Sep 18, 2024
1 parent b3af68a commit 9b60c73
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
12 changes: 8 additions & 4 deletions ldcomponents/polling_data_source_builder_v2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,11 @@ func TestPollingDataSourceV2Builder(t *testing.T) {

p := PollingDataSourceV2()

dsu := mocks.NewMockDataSourceUpdates(datastore.NewInMemoryDataStore(sharedtest.NewTestLoggers()))
dd := mocks.NewMockDataDestination(datastore.NewInMemoryDataStore(sharedtest.NewTestLoggers()))
statusReporter := mocks.NewMockStatusReporter()
clientContext := makeTestContextWithBaseURIs(baseURI)
clientContext.BasicClientContext.DataSourceUpdateSink = dsu
clientContext.BasicClientContext.DataDestination = dd
clientContext.BasicClientContext.DataSourceStatusReporter = statusReporter
ds, err := p.Build(clientContext)
require.NoError(t, err)
require.NotNil(t, ds)
Expand All @@ -79,9 +81,11 @@ func TestPollingDataSourceV2Builder(t *testing.T) {

p := PollingDataSourceV2().PollInterval(interval).PayloadFilter(filter)

dsu := mocks.NewMockDataSourceUpdates(datastore.NewInMemoryDataStore(sharedtest.NewTestLoggers()))
dd := mocks.NewMockDataDestination(datastore.NewInMemoryDataStore(sharedtest.NewTestLoggers()))
statusReporter := mocks.NewMockStatusReporter()
clientContext := makeTestContextWithBaseURIs(baseURI)
clientContext.BasicClientContext.DataSourceUpdateSink = dsu
clientContext.BasicClientContext.DataDestination = dd
clientContext.BasicClientContext.DataSourceStatusReporter = statusReporter
ds, err := p.Build(clientContext)
require.NoError(t, err)
require.NotNil(t, ds)
Expand Down
8 changes: 4 additions & 4 deletions ldcomponents/streaming_data_source_builder_v2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ func TestStreamingDataSourceV2Builder(t *testing.T) {

s := StreamingDataSourceV2()

dsu := mocks.NewMockDataDestination(datastore.NewInMemoryDataStore(sharedtest.NewTestLoggers()))
dd := mocks.NewMockDataDestination(datastore.NewInMemoryDataStore(sharedtest.NewTestLoggers()))
statusReporter := mocks.NewMockStatusReporter()
clientContext := makeTestContextWithBaseURIs(baseURI)
clientContext.BasicClientContext.DataDestination = dsu
clientContext.BasicClientContext.DataDestination = dd
clientContext.BasicClientContext.DataSourceStatusReporter = statusReporter
ds, err := s.Build(clientContext)
require.NoError(t, err)
Expand All @@ -83,10 +83,10 @@ func TestStreamingDataSourceV2Builder(t *testing.T) {

s := StreamingDataSourceV2().InitialReconnectDelay(delay).PayloadFilter(filter)

dsu := mocks.NewMockDataDestination(datastore.NewInMemoryDataStore(sharedtest.NewTestLoggers()))
dd := mocks.NewMockDataDestination(datastore.NewInMemoryDataStore(sharedtest.NewTestLoggers()))
statusReporter := mocks.NewMockStatusReporter()
clientContext := makeTestContextWithBaseURIs(baseURI)
clientContext.BasicClientContext.DataDestination = dsu
clientContext.BasicClientContext.DataDestination = dd
clientContext.BasicClientContext.DataSourceStatusReporter = statusReporter
ds, err := s.Build(clientContext)
require.NoError(t, err)
Expand Down

0 comments on commit 9b60c73

Please sign in to comment.