@@ -2076,9 +2076,7 @@ public void batchCheck_withOptions() throws Exception {
20762076 public void batchCheck_rateLimited () {
20772077 // Given
20782078 String postUrl = String .format ("https://api.fga.example/stores/%s/batch-check" , DEFAULT_STORE_ID );
2079- mockHttpClient
2080- .onPost (postUrl )
2081- .doReturn (429 , "{\" code\" :\" rate_limited\" ,\" message\" :\" Too Many Requests\" }" );
2079+ mockHttpClient .onPost (postUrl ).doReturn (429 , "{\" code\" :\" rate_limited\" ,\" message\" :\" Too Many Requests\" }" );
20822080
20832081 ClientBatchCheckItem item = new ClientBatchCheckItem ()
20842082 .user (DEFAULT_USER )
@@ -2088,15 +2086,14 @@ public void batchCheck_rateLimited() {
20882086 ClientBatchCheckRequest request = new ClientBatchCheckRequest ().checks (List .of (item ));
20892087
20902088 // When
2091- ExecutionException execException =
2092- assertThrows ( ExecutionException .class , () -> fga .batchCheck (request ).get ());
2089+ ExecutionException execException = assertThrows (
2090+ ExecutionException .class , () -> fga .batchCheck (request ).get ());
20932091
20942092 // Then
20952093 mockHttpClient .verify ().post (postUrl ).called (1 + DEFAULT_MAX_RETRIES );
20962094 var exception = assertInstanceOf (FgaApiRateLimitExceededError .class , execException .getCause ());
20972095 assertEquals (429 , exception .getStatusCode ());
2098- assertEquals (
2099- "{\" code\" :\" rate_limited\" ,\" message\" :\" Too Many Requests\" }" , exception .getResponseData ());
2096+ assertEquals ("{\" code\" :\" rate_limited\" ,\" message\" :\" Too Many Requests\" }" , exception .getResponseData ());
21002097 }
21012098
21022099 /**
0 commit comments