@@ -3519,11 +3519,11 @@ func TestGRPCProvider_ReadStateBytes(t *testing.T) {
3519
3519
chunks := []string {"hello" , "world" }
3520
3520
totalLength := len (chunks [0 ]) + len (chunks [1 ])
3521
3521
mockResp := map [int ]struct {
3522
- resp * proto.ReadStateBytes_ResponseChunk
3522
+ resp * proto.ReadStateBytes_Response
3523
3523
err error
3524
3524
}{
3525
3525
0 : {
3526
- resp : & proto.ReadStateBytes_ResponseChunk {
3526
+ resp : & proto.ReadStateBytes_Response {
3527
3527
Bytes : []byte (chunks [0 ]),
3528
3528
TotalLength : int64 (totalLength ),
3529
3529
Range : & proto.StateRange {
@@ -3534,7 +3534,7 @@ func TestGRPCProvider_ReadStateBytes(t *testing.T) {
3534
3534
err : nil ,
3535
3535
},
3536
3536
1 : {
3537
- resp : & proto.ReadStateBytes_ResponseChunk {
3537
+ resp : & proto.ReadStateBytes_Response {
3538
3538
Bytes : []byte (chunks [1 ]),
3539
3539
TotalLength : int64 (totalLength ),
3540
3540
Range : & proto.StateRange {
@@ -3545,12 +3545,12 @@ func TestGRPCProvider_ReadStateBytes(t *testing.T) {
3545
3545
err : nil ,
3546
3546
},
3547
3547
2 : {
3548
- resp : nil ,
3548
+ resp : & proto. ReadStateBytes_Response {} ,
3549
3549
err : io .EOF ,
3550
3550
},
3551
3551
}
3552
3552
var count int
3553
- mockReadBytesClient .EXPECT ().Recv ().DoAndReturn (func () (* proto.ReadStateBytes_ResponseChunk , error ) {
3553
+ mockReadBytesClient .EXPECT ().Recv ().DoAndReturn (func () (* proto.ReadStateBytes_Response , error ) {
3554
3554
ret := mockResp [count ]
3555
3555
count ++
3556
3556
return ret .resp , ret .err
@@ -3595,11 +3595,11 @@ func TestGRPCProvider_ReadStateBytes(t *testing.T) {
3595
3595
var incorrectLength int64 = 999
3596
3596
correctLength := len (chunks [0 ]) + len (chunks [1 ])
3597
3597
mockResp := map [int ]struct {
3598
- resp * proto.ReadStateBytes_ResponseChunk
3598
+ resp * proto.ReadStateBytes_Response
3599
3599
err error
3600
3600
}{
3601
3601
0 : {
3602
- resp : & proto.ReadStateBytes_ResponseChunk {
3602
+ resp : & proto.ReadStateBytes_Response {
3603
3603
Bytes : []byte (chunks [0 ]),
3604
3604
TotalLength : incorrectLength ,
3605
3605
Range : & proto.StateRange {
@@ -3610,7 +3610,7 @@ func TestGRPCProvider_ReadStateBytes(t *testing.T) {
3610
3610
err : nil ,
3611
3611
},
3612
3612
1 : {
3613
- resp : & proto.ReadStateBytes_ResponseChunk {
3613
+ resp : & proto.ReadStateBytes_Response {
3614
3614
Bytes : []byte (chunks [1 ]),
3615
3615
TotalLength : incorrectLength ,
3616
3616
Range : & proto.StateRange {
@@ -3621,12 +3621,12 @@ func TestGRPCProvider_ReadStateBytes(t *testing.T) {
3621
3621
err : nil ,
3622
3622
},
3623
3623
2 : {
3624
- resp : nil ,
3624
+ resp : & proto. ReadStateBytes_Response {} ,
3625
3625
err : io .EOF ,
3626
3626
},
3627
3627
}
3628
3628
var count int
3629
- mockReadBytesClient .EXPECT ().Recv ().DoAndReturn (func () (* proto.ReadStateBytes_ResponseChunk , error ) {
3629
+ mockReadBytesClient .EXPECT ().Recv ().DoAndReturn (func () (* proto.ReadStateBytes_Response , error ) {
3630
3630
ret := mockResp [count ]
3631
3631
count ++
3632
3632
return ret .resp , ret .err
@@ -3702,7 +3702,7 @@ func TestGRPCProvider_ReadStateBytes(t *testing.T) {
3702
3702
).Return (mockReadBytesClient , nil )
3703
3703
3704
3704
// Define what will be returned by each call to Recv
3705
- mockReadBytesClient .EXPECT ().Recv ().Return (& proto.ReadStateBytes_ResponseChunk {
3705
+ mockReadBytesClient .EXPECT ().Recv ().Return (& proto.ReadStateBytes_Response {
3706
3706
Diagnostics : []* proto.Diagnostic {
3707
3707
& proto.Diagnostic {
3708
3708
Severity : proto .Diagnostic_ERROR ,
@@ -3752,15 +3752,15 @@ func TestGRPCProvider_ReadStateBytes(t *testing.T) {
3752
3752
).Return (mockReadBytesClient , nil )
3753
3753
3754
3754
// Define what will be returned by each call to Recv
3755
- mockReadBytesClient .EXPECT ().Recv ().Return (& proto.ReadStateBytes_ResponseChunk {
3755
+ mockReadBytesClient .EXPECT ().Recv ().Return (& proto.ReadStateBytes_Response {
3756
3756
Diagnostics : []* proto.Diagnostic {
3757
3757
& proto.Diagnostic {
3758
3758
Severity : proto .Diagnostic_WARNING ,
3759
3759
Summary : "Warning from test" ,
3760
3760
Detail : "This warning is forced by the test case" ,
3761
3761
},
3762
3762
},
3763
- }, nil )
3763
+ }, io . EOF )
3764
3764
3765
3765
// Act
3766
3766
request := providers.ReadStateBytesRequest {
@@ -3801,7 +3801,7 @@ func TestGRPCProvider_ReadStateBytes(t *testing.T) {
3801
3801
).Return (mockClient , nil )
3802
3802
3803
3803
mockError := errors .New ("grpc error forced in test" )
3804
- mockClient .EXPECT ().Recv ().Return (& proto.ReadStateBytes_ResponseChunk {}, mockError )
3804
+ mockClient .EXPECT ().Recv ().Return (& proto.ReadStateBytes_Response {}, mockError )
3805
3805
3806
3806
// Act
3807
3807
request := providers.ReadStateBytesRequest {
0 commit comments