@@ -149,7 +149,7 @@ func (s *ClientInterceptorTestSuite) SetupSuite() {
149149 s .mock = & mockReportable {}
150150
151151 s .serverListener , err = net .Listen ("tcp" , "127.0.0.1:0" )
152- require . NoError ( s . T (), err , "must be able to allocate a port for serverListener" )
152+ s . Require (). NoError ( err , "must be able to allocate a port for serverListener" )
153153
154154 s .server = grpc .NewServer ()
155155 testpb .RegisterTestServiceServer (s .server , & testpb.TestPingService {})
@@ -166,7 +166,7 @@ func (s *ClientInterceptorTestSuite) SetupSuite() {
166166 grpc .WithUnaryInterceptor (UnaryClientInterceptor (s .mock )),
167167 grpc .WithStreamInterceptor (StreamClientInterceptor (s .mock )),
168168 )
169- require . NoError ( s . T (), err , "must not error on client Dial" )
169+ s . Require (). NoError ( err , "must not error on client Dial" )
170170 s .testClient = testpb .NewTestServiceClient (s .clientConn )
171171}
172172
@@ -200,7 +200,7 @@ func (s *ClientInterceptorTestSuite) TearDownTest() {
200200
201201func (s * ClientInterceptorTestSuite ) TestUnaryReporting () {
202202 _ , err := s .testClient .PingEmpty (s .ctx , & testpb.PingEmptyRequest {}) // should return with code=OK
203- require . NoError ( s . T (), err )
203+ s . Require (). NoError ( err )
204204 s .mock .Equal (s .T (), []* mockReport {{
205205 CallMeta : CallMeta {Typ : Unary , Service : testpb .TestServiceFullName , Method : "PingEmpty" },
206206 postCalls : []error {nil },
@@ -210,7 +210,7 @@ func (s *ClientInterceptorTestSuite) TestUnaryReporting() {
210210 s .mock .reports = s .mock .reports [:0 ] // Reset.
211211
212212 _ , err = s .testClient .PingError (s .ctx , & testpb.PingErrorRequest {ErrorCodeReturned : uint32 (codes .FailedPrecondition )}) // should return with code=FailedPrecondition
213- require . Error ( s . T (), err )
213+ s . Require (). Error ( err )
214214 s .mock .Equal (s .T (), []* mockReport {{
215215 CallMeta : CallMeta {Typ : Unary , Service : testpb .TestServiceFullName , Method : "PingError" },
216216 postCalls : []error {status .Error (codes .FailedPrecondition , "Userspace error" )},
@@ -221,7 +221,7 @@ func (s *ClientInterceptorTestSuite) TestUnaryReporting() {
221221
222222func (s * ClientInterceptorTestSuite ) TestStartedListReporting () {
223223 _ , err := s .testClient .PingList (s .ctx , & testpb.PingListRequest {})
224- require . NoError ( s . T (), err )
224+ s . Require (). NoError ( err )
225225
226226 // Even without reading, we should get initial mockReport.
227227 s .mock .Equal (s .T (), []* mockReport {{
@@ -230,7 +230,7 @@ func (s *ClientInterceptorTestSuite) TestStartedListReporting() {
230230 }})
231231
232232 _ , err = s .testClient .PingList (s .ctx , & testpb.PingListRequest {ErrorCodeReturned : uint32 (codes .FailedPrecondition )})
233- require . NoError ( s . T (), err , "PingList must not fail immediately" )
233+ s . Require (). NoError ( err , "PingList must not fail immediately" )
234234
235235 // Even without reading, we should get initial mockReport.
236236 s .mock .Equal (s .T (), []* mockReport {{
@@ -244,7 +244,7 @@ func (s *ClientInterceptorTestSuite) TestStartedListReporting() {
244244
245245func (s * ClientInterceptorTestSuite ) TestListReporting () {
246246 ss , err := s .testClient .PingList (s .ctx , & testpb.PingListRequest {})
247- require . NoError ( s . T (), err )
247+ s . Require (). NoError ( err )
248248
249249 // Do a read, just for kicks.
250250 count := 0
@@ -253,10 +253,10 @@ func (s *ClientInterceptorTestSuite) TestListReporting() {
253253 if errors .Is (err , io .EOF ) {
254254 break
255255 }
256- require . NoError ( s . T (), err , "reading pingList shouldn't fail" )
256+ s . Require (). NoError ( err , "reading pingList shouldn't fail" )
257257 count ++
258258 }
259- require . EqualValues ( s . T (), testpb .ListResponseCount , count , "Number of received msg on the wire must match" )
259+ s . Require (). Equal ( testpb .ListResponseCount , count , "Number of received msg on the wire must match" )
260260
261261 s .mock .Equal (s .T (), []* mockReport {{
262262 CallMeta : CallMeta {Typ : ServerStream , Service : testpb .TestServiceFullName , Method : "PingList" },
@@ -267,19 +267,19 @@ func (s *ClientInterceptorTestSuite) TestListReporting() {
267267 s .mock .reports = s .mock .reports [:0 ] // Reset.
268268
269269 ss , err = s .testClient .PingList (s .ctx , & testpb.PingListRequest {ErrorCodeReturned : uint32 (codes .FailedPrecondition )})
270- require . NoError ( s . T (), err , "PingList must not fail immediately" )
270+ s . Require (). NoError ( err , "PingList must not fail immediately" )
271271
272272 // Do a read, just to propagate errors.
273273 _ , err = ss .Recv ()
274- require . Error ( s . T (), err )
274+ s . Require (). Error ( err )
275275 st , _ := status .FromError (err )
276- require . Equal ( s . T (), codes .FailedPrecondition , st .Code (), "Recv must return FailedPrecondition, otherwise the test is wrong" )
276+ s . Require (). Equal ( codes .FailedPrecondition , st .Code (), "Recv must return FailedPrecondition, otherwise the test is wrong" )
277277
278278 // Next same.
279279 _ , err = ss .Recv ()
280- require . Error ( s . T (), err )
280+ s . Require (). Error ( err )
281281 st , _ = status .FromError (err )
282- require . Equal ( s . T (), codes .FailedPrecondition , st .Code (), "Recv must return FailedPrecondition, otherwise the test is wrong" )
282+ s . Require (). Equal ( codes .FailedPrecondition , st .Code (), "Recv must return FailedPrecondition, otherwise the test is wrong" )
283283
284284 s .mock .Equal (s .T (), []* mockReport {{
285285 CallMeta : CallMeta {Typ : ServerStream , Service : testpb .TestServiceFullName , Method : "PingList" },
@@ -291,7 +291,7 @@ func (s *ClientInterceptorTestSuite) TestListReporting() {
291291
292292func (s * ClientInterceptorTestSuite ) TestBiStreamingReporting () {
293293 ss , err := s .testClient .PingStream (s .ctx )
294- require . NoError ( s . T (), err )
294+ s . Require (). NoError ( err )
295295
296296 wg := sync.WaitGroup {}
297297 defer func () {
@@ -316,13 +316,13 @@ func (s *ClientInterceptorTestSuite) TestBiStreamingReporting() {
316316 }
317317 }()
318318 for i := 0 ; i < 100 ; i ++ {
319- require . NoError ( s . T (), ss .Send (& testpb.PingStreamRequest {}), "sending shouldn't fail" )
319+ s . Require (). NoError ( ss .Send (& testpb.PingStreamRequest {}), "sending shouldn't fail" )
320320 }
321321
322- require . NoError ( s . T (), ss .CloseSend ())
322+ s . Require (). NoError ( ss .CloseSend ())
323323 wg .Wait ()
324324
325- require . EqualValues ( s . T (), 100 , count , "Number of received msg on the wire must match" )
325+ s . Require (). Equal ( 100 , count , "Number of received msg on the wire must match" )
326326 s .mock .Equal (s .T (), []* mockReport {{
327327 CallMeta : CallMeta {Typ : BidiStream , Service : testpb .TestServiceFullName , Method : "PingStream" },
328328 postCalls : []error {nil },
@@ -333,18 +333,18 @@ func (s *ClientInterceptorTestSuite) TestBiStreamingReporting() {
333333
334334func (s * ClientInterceptorTestSuite ) TestClientStream () {
335335 ss , err := s .testClient .PingClientStream (s .ctx )
336- require . NoError ( s . T (), err )
336+ s . Require (). NoError ( err )
337337
338338 defer func () {
339339 _ , _ = ss .CloseAndRecv ()
340340 }()
341341
342342 for i := 0 ; i < 100 ; i ++ {
343- require . NoError ( s . T (), ss .Send (& testpb.PingClientStreamRequest {}), "sending shouldn't fail" )
343+ s . Require (). NoError ( ss .Send (& testpb.PingClientStreamRequest {}), "sending shouldn't fail" )
344344 }
345345
346346 _ , err = ss .CloseAndRecv ()
347- require . NoError ( s . T (), err )
347+ s . Require (). NoError ( err )
348348
349349 s .mock .Equal (s .T (), []* mockReport {{
350350 CallMeta : CallMeta {Typ : ClientStream , Service : testpb .TestServiceFullName , Method : "PingClientStream" },
0 commit comments