Skip to content

Commit ddb73d4

Browse files
fix serialization tests
1 parent 4cf1ad7 commit ddb73d4

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authc/AuthenticationSerializationTests.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,10 @@ public void testWriteToWithCrossClusterAccessThrowsOnUnsupportedVersion() throws
117117

118118
public void testWriteToAndReadFromWithCloudApiKeyAuthentication() throws Exception {
119119
final Authentication authentication = Authentication.newCloudApiKeyAuthentication(
120-
AuthenticationResult.success(new User(randomAlphanumericOfLength(5), "superuser"), Map.of()),
120+
AuthenticationResult.success(
121+
new User(randomAlphanumericOfLength(5), "superuser"),
122+
Map.of(AuthenticationField.API_KEY_ID_KEY, "test-api-key-id")
123+
),
121124
randomAlphanumericOfLength(10)
122125
);
123126

@@ -134,7 +137,10 @@ public void testWriteToAndReadFromWithCloudApiKeyAuthentication() throws Excepti
134137

135138
public void testWriteToWithCloudApiKeyThrowsOnUnsupportedVersion() {
136139
final Authentication authentication = Authentication.newCloudApiKeyAuthentication(
137-
AuthenticationResult.success(new User(randomAlphanumericOfLength(5), "superuser"), Map.of()),
140+
AuthenticationResult.success(
141+
new User(randomAlphanumericOfLength(5), "superuser"),
142+
Map.of(AuthenticationField.API_KEY_ID_KEY, "test-api-key-id")
143+
),
138144
randomAlphanumericOfLength(10)
139145
);
140146

0 commit comments

Comments
 (0)