@@ -288,7 +288,7 @@ void buildRequestWithDataParameterOnly() throws Exception {
288288 data = "0xd5fa2b00" ;
289289
290290 okhttp3 .Request request = ensResolver .buildRequest (url , sender , data );
291-
291+
292292 assertEquals ("https://example.com/gateway/0xd5fa2b00.json" , request .url ().toString ());
293293 assertEquals ("GET" , request .method ());
294294 assertNull (request .body ());
@@ -301,8 +301,9 @@ void buildRequestWithSenderParameterOnly() throws Exception {
301301 data = "0xd5fa2b00" ;
302302
303303 okhttp3 .Request request = ensResolver .buildRequest (url , sender , data );
304-
305- assertEquals ("https://example.com/gateway/0x226159d592E2b063810a10Ebf6dcbADA94Ed68b8/lookup" ,
304+
305+ assertEquals (
306+ "https://example.com/gateway/0x226159d592E2b063810a10Ebf6dcbADA94Ed68b8/lookup" ,
306307 request .url ().toString ());
307308 assertEquals ("POST" , request .method ());
308309 assertNotNull (request .body ());
@@ -329,8 +330,9 @@ void buildRequestWithBothParameters() throws Exception {
329330 data = "0xd5fa2b00" ;
330331
331332 okhttp3 .Request request = ensResolver .buildRequest (url , sender , data );
332-
333- assertEquals ("https://example.com/gateway/0x226159d592E2b063810a10Ebf6dcbADA94Ed68b8/0xd5fa2b00" ,
333+
334+ assertEquals (
335+ "https://example.com/gateway/0x226159d592E2b063810a10Ebf6dcbADA94Ed68b8/0xd5fa2b00" ,
334336 request .url ().toString ());
335337 assertEquals ("GET" , request .method ());
336338 assertNull (request .body ());
@@ -492,7 +494,8 @@ void resolveOffchainWhenLookUpCallsOutOfLimit() throws Exception {
492494 buildResponse (200 , urls .get (0 ), sender , data ));
493495
494496 String eip3668Data = EnsUtils .EIP_3668_CCIP_INTERFACE_ID + "data" ;
495- when (resolver .executeCallWithoutDecoding (any ())).thenReturn (eip3668Data , eip3668Data , eip3668Data );
497+ when (resolver .executeCallWithoutDecoding (any ()))
498+ .thenReturn (eip3668Data , eip3668Data , eip3668Data );
496499
497500 assertThrows (
498501 EnsResolutionException .class ,
@@ -514,18 +517,21 @@ void resolveOffchainWithDynamicCallback() throws Exception {
514517
515518 // Create a custom LOOKUP_HEX with a different callback function
516519 String customCallbackSelector = "aabbccdd" ;
517- String customLookupHex = LOOKUP_HEX .substring (0 , 202 ) + customCallbackSelector + LOOKUP_HEX .substring (210 );
518-
520+ String customLookupHex =
521+ LOOKUP_HEX .substring (0 , 202 ) + customCallbackSelector + LOOKUP_HEX .substring (210 );
522+
519523 // Capture the function call to verify the correct callback selector is used
520524 ArgumentCaptor <String > functionCallCaptor = ArgumentCaptor .forClass (String .class );
521- when (resolver .executeCallWithoutDecoding (functionCallCaptor .capture ())).thenReturn (RESOLVED_NAME_HEX );
525+ when (resolver .executeCallWithoutDecoding (functionCallCaptor .capture ()))
526+ .thenReturn (RESOLVED_NAME_HEX );
522527
523528 String result = ensResolver .resolveOffchain (customLookupHex , resolver , 4 );
524529 assertEquals ("0x41563129cdbbd0c5d3e1c86cf9563926b243834d" , result );
525-
530+
526531 // Verify that the captured function call starts with our custom callback selector
527532 String capturedFunctionCall = functionCallCaptor .getValue ();
528- assertTrue (capturedFunctionCall .startsWith ("0x" + customCallbackSelector ),
533+ assertTrue (
534+ capturedFunctionCall .startsWith ("0x" + customCallbackSelector ),
529535 "Function call should start with the custom callback selector" );
530536 }
531537
@@ -541,27 +547,30 @@ void resolveOffchainParameterEncoding() throws Exception {
541547
542548 EnsGatewayResponseDTO responseDTO = new EnsGatewayResponseDTO (testData );
543549 String responseJson = om .writeValueAsString (responseDTO );
544-
545- okhttp3 .Response responseObj = new okhttp3 .Response .Builder ()
546- .request (new okhttp3 .Request .Builder ().url (urls .get (0 )).build ())
547- .protocol (Protocol .HTTP_2 )
548- .code (200 )
549- .body (ResponseBody .create (responseJson , JSON_MEDIA_TYPE ))
550- .message ("OK" )
551- .build ();
552-
550+
551+ okhttp3 .Response responseObj =
552+ new okhttp3 .Response .Builder ()
553+ .request (new okhttp3 .Request .Builder ().url (urls .get (0 )).build ())
554+ .protocol (Protocol .HTTP_2 )
555+ .code (200 )
556+ .body (ResponseBody .create (responseJson , JSON_MEDIA_TYPE ))
557+ .message ("OK" )
558+ .build ();
559+
553560 ensResolver .setHttpClient (httpClientMock );
554561 when (httpClientMock .newCall (any ())).thenReturn (call );
555562 when (call .execute ()).thenReturn (responseObj );
556563
557564 ArgumentCaptor <String > functionCallCaptor = ArgumentCaptor .forClass (String .class );
558- when (resolver .executeCallWithoutDecoding (functionCallCaptor .capture ())).thenReturn (RESOLVED_NAME_HEX );
565+ when (resolver .executeCallWithoutDecoding (functionCallCaptor .capture ()))
566+ .thenReturn (RESOLVED_NAME_HEX );
559567
560568 String result = ensResolver .resolveOffchain (LOOKUP_HEX , resolver , 4 );
561569 assertEquals ("0x41563129cdbbd0c5d3e1c86cf9563926b243834d" , result );
562570
563571 String capturedFunctionCall = functionCallCaptor .getValue ();
564- assertTrue (capturedFunctionCall .contains (testData .substring (2 )),
572+ assertTrue (
573+ capturedFunctionCall .contains (testData .substring (2 )),
565574 "Function call should contain the encoded test data" );
566575 }
567576
0 commit comments