Skip to content

Commit 9decc75

Browse files
fix string interpolator
1 parent 26d2594 commit 9decc75

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

plugins/microsoft-graph-authz/src/main/java/org/elasticsearch/xpack/security/authz/microsoft/MicrosoftGraphAuthzRealm.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ private void doLookupUser(String principal, ActionListener<User> listener) {
157157
l.onResponse(user);
158158
}));
159159
} catch (Exception e) {
160-
logger.error(Strings.format("Failed to authorize [{}] with MS Graph realm", principal), e);
160+
logger.error(Strings.format("Failed to authorize [%s] with MS Graph realm", principal), e);
161161
listener.onFailure(e);
162162
}
163163
}

plugins/microsoft-graph-authz/src/test/java/org/elasticsearch/xpack/security/authz/microsoft/MicrosoftGraphAuthzRealmTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public class MicrosoftGraphAuthzRealmTests extends ESTestCase {
7272
private final String roleName = randomAlphaOfLengthBetween(4, 10);
7373
private final String username = randomAlphaOfLengthBetween(4, 10);
7474
private final String name = randomAlphaOfLengthBetween(4, 10);
75-
private final String email = Strings.format("[%s]@example.com", randomAlphaOfLengthBetween(4, 10));
75+
private final String email = Strings.format("%s@example.com", randomAlphaOfLengthBetween(4, 10));
7676
private final String groupId = randomAlphaOfLengthBetween(4, 10);
7777
private final RealmConfig.RealmIdentifier realmId = new RealmConfig.RealmIdentifier(
7878
MicrosoftGraphAuthzRealmSettings.REALM_TYPE,
@@ -190,7 +190,7 @@ public void testHandleGetUserPropertiesError() {
190190
"Log exception",
191191
MicrosoftGraphAuthzRealm.class.getName(),
192192
Level.ERROR,
193-
Strings.format("Failed to authorize [{}] with MS Graph realm", username)
193+
Strings.format("Failed to authorize [%s] with MS Graph realm", username)
194194
)
195195
);
196196

@@ -228,7 +228,7 @@ public void testHandleGetGroupMembershipError() {
228228
"Log exception",
229229
MicrosoftGraphAuthzRealm.class.getName(),
230230
Level.ERROR,
231-
Strings.format("Failed to authorize [{}] with MS Graph realm", username)
231+
Strings.format("Failed to authorize [%s] with MS Graph realm", username)
232232
)
233233
);
234234

0 commit comments

Comments
 (0)