From 9b60c73507b53e5d4e9621ccaaa3db23bbe1e2af Mon Sep 17 00:00:00 2001 From: Casey Waldren Date: Wed, 18 Sep 2024 13:06:42 -0700 Subject: [PATCH] update polling builder to use DataDestination/StatusReporter --- ldcomponents/polling_data_source_builder_v2_test.go | 12 ++++++++---- .../streaming_data_source_builder_v2_test.go | 8 ++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/ldcomponents/polling_data_source_builder_v2_test.go b/ldcomponents/polling_data_source_builder_v2_test.go index 6ab2c61f..fe0e686d 100644 --- a/ldcomponents/polling_data_source_builder_v2_test.go +++ b/ldcomponents/polling_data_source_builder_v2_test.go @@ -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) @@ -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) diff --git a/ldcomponents/streaming_data_source_builder_v2_test.go b/ldcomponents/streaming_data_source_builder_v2_test.go index 3ec459e7..7c51ea90 100644 --- a/ldcomponents/streaming_data_source_builder_v2_test.go +++ b/ldcomponents/streaming_data_source_builder_v2_test.go @@ -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) @@ -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)