88
99 "github.com/stretchr/testify/require"
1010
11- subclient "github.com/wundergraph/graphql-go-tools/v2/pkg/engine/datasource/graphql_datasource/subscriptionclient/client "
11+ client "github.com/wundergraph/graphql-go-tools/v2/pkg/engine/datasource/graphql_datasource/subscriptionclient"
1212 "github.com/wundergraph/graphql-go-tools/v2/pkg/engine/resolve"
1313)
1414
@@ -43,13 +43,13 @@ func (t *testBridgeUpdater) Subscriptions() map[context.Context]resolve.Subscrip
4343
4444func TestCloseKindForMessageError (t * testing.T ) {
4545 t .Run ("connection closed uses downstream service error close kind" , func (t * testing.T ) {
46- closeKind , sendPayload := closeKindForMessageError (subclient .ErrConnectionClosed )
46+ closeKind , sendPayload := closeKindForMessageError (client .ErrConnectionClosed )
4747 require .Equal (t , resolve .SubscriptionCloseKindDownstreamServiceError , closeKind )
4848 require .False (t , sendPayload )
4949 })
5050
5151 t .Run ("connection error uses downstream service error close kind" , func (t * testing.T ) {
52- err := fmt .Errorf ("wrapped: %w" , subclient .ErrConnectionError )
52+ err := fmt .Errorf ("wrapped: %w" , client .ErrConnectionError )
5353 closeKind , sendPayload := closeKindForMessageError (err )
5454 require .Equal (t , resolve .SubscriptionCloseKindDownstreamServiceError , closeKind )
5555 require .False (t , sendPayload )
@@ -65,12 +65,12 @@ func TestCloseKindForMessageError(t *testing.T) {
6565func TestSubscriptionClientV2ReadLoopCloseKinds (t * testing.T ) {
6666 t .Run ("connection errors close as downstream service error without payload" , func (t * testing.T ) {
6767 updater := & testBridgeUpdater {}
68- msgCh := make (chan * subclient .Message , 1 )
69- msgCh <- & subclient .Message {Err : subclient .ErrConnectionClosed }
68+ msgCh := make (chan * client .Message , 1 )
69+ msgCh <- & client .Message {Err : client .ErrConnectionClosed }
7070 close (msgCh )
7171
72- client := & subscriptionClientV2 {}
73- client .readLoop (context .Background (), msgCh , func () {}, updater )
72+ subClient := & subscriptionClientV2 {}
73+ subClient .readLoop (context .Background (), msgCh , func () {}, updater )
7474
7575 require .True (t , updater .closed )
7676 require .Equal (t , resolve .SubscriptionCloseKindDownstreamServiceError , updater .closeKind )
@@ -80,12 +80,12 @@ func TestSubscriptionClientV2ReadLoopCloseKinds(t *testing.T) {
8080
8181 t .Run ("non-connection errors send payload and close normally" , func (t * testing.T ) {
8282 updater := & testBridgeUpdater {}
83- msgCh := make (chan * subclient .Message , 1 )
84- msgCh <- & subclient .Message {Err : errors .New ("validation failed" )}
83+ msgCh := make (chan * client .Message , 1 )
84+ msgCh <- & client .Message {Err : errors .New ("validation failed" )}
8585 close (msgCh )
8686
87- client := & subscriptionClientV2 {}
88- client .readLoop (context .Background (), msgCh , func () {}, updater )
87+ subClient := & subscriptionClientV2 {}
88+ subClient .readLoop (context .Background (), msgCh , func () {}, updater )
8989
9090 require .True (t , updater .closed )
9191 require .Equal (t , resolve .SubscriptionCloseKindNormal , updater .closeKind )
0 commit comments