Skip to content

Commit e176a10

Browse files
committed
fix: spotlessapply
1 parent 258b743 commit e176a10

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/main/java/dev/openfga/sdk/api/client/ApiExecutorRequestBuilder.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,14 +210,12 @@ HttpRequest buildHttpRequest(Configuration configuration, ApiClient apiClient)
210210

211211
// Attach authorization header if credentials are configured and the caller
212212
// has not already provided one.
213-
boolean hasAuthorizationHeader =
214-
headers.keySet().stream().anyMatch("Authorization"::equalsIgnoreCase);
213+
boolean hasAuthorizationHeader = headers.keySet().stream().anyMatch("Authorization"::equalsIgnoreCase);
215214
String accessToken = apiClient.getAccessToken(configuration);
216215
if (!hasAuthorizationHeader && accessToken != null) {
217216
httpRequestBuilder.header("Authorization", "Bearer " + accessToken);
218217
}
219218

220-
221219
if (apiClient.getRequestInterceptor() != null) {
222220
apiClient.getRequestInterceptor().accept(httpRequestBuilder);
223221
}

src/test/java/dev/openfga/sdk/api/client/OpenFgaClientTest.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,11 @@ public void beforeEachTest() throws Exception {
9292
// Allow setOAuth2Client to store the value and getAccessToken to use real logic
9393
final OAuth2Client[] oAuth2ClientHolder = new OAuth2Client[1];
9494
doAnswer(invocation -> {
95-
oAuth2ClientHolder[0] = invocation.getArgument(0);
96-
return null;
97-
}).when(mockApiClient).setOAuth2Client(any());
95+
oAuth2ClientHolder[0] = invocation.getArgument(0);
96+
return null;
97+
})
98+
.when(mockApiClient)
99+
.setOAuth2Client(any());
98100
when(mockApiClient.getAccessToken(any())).thenAnswer(invocation -> {
99101
Configuration config = invocation.getArgument(0);
100102
var credentialsMethod = config.getCredentials().getCredentialsMethod();

0 commit comments

Comments
 (0)