Skip to content

Commit bc55bfb

Browse files
adjust authentication tests
1 parent 9495904 commit bc55bfb

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

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

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -800,7 +800,12 @@ public void testToXContentWithApiKey() throws IOException {
800800
authentication1,
801801
m -> assertThat(
802802
m,
803-
hasEntry("api_key", apiKeyName != null ? Map.of("id", apiKeyId, "name", apiKeyName) : Map.of("id", apiKeyId))
803+
hasEntry(
804+
"api_key",
805+
apiKeyName != null
806+
? Map.of("id", apiKeyId, "name", apiKeyName, "managed_by", "elasticsearch")
807+
: Map.of("id", apiKeyId, "managed_by", "elasticsearch")
808+
)
804809
)
805810
);
806811

@@ -820,7 +825,12 @@ public void testToXContentWithCrossClusterAccess() throws IOException {
820825
authentication,
821826
m -> assertThat(
822827
m,
823-
hasEntry("api_key", apiKeyName != null ? Map.of("id", apiKeyId, "name", apiKeyName) : Map.of("id", apiKeyId))
828+
hasEntry(
829+
"api_key",
830+
apiKeyName != null
831+
? Map.of("id", apiKeyId, "name", apiKeyName, "managed_by", "elasticsearch")
832+
: Map.of("id", apiKeyId, "managed_by", "elasticsearch")
833+
)
824834
)
825835
);
826836
}

0 commit comments

Comments
 (0)