Skip to content

Commit c235e20

Browse files
committed
Fix ApiKeyServiceTests (#46773)
Follow-up to #46773
1 parent 7ec9d1b commit c235e20

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

+3-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import org.elasticsearch.common.xcontent.XContentHelper;
2828
import org.elasticsearch.common.xcontent.XContentType;
2929
import org.elasticsearch.common.xcontent.json.JsonXContent;
30+
import org.elasticsearch.index.shard.ShardId;
3031
import org.elasticsearch.license.XPackLicenseState;
3132
import org.elasticsearch.search.SearchHit;
3233
import org.elasticsearch.test.ClusterServiceUtils;
@@ -195,7 +196,8 @@ public void testStoreApiKey() throws ExecutionException, InterruptedException {
195196
assertThat(((Map) source.get("creator")).get("principal"), Matchers.equalTo(user.principal()));
196197

197198
ActionListener<IndexResponse> listener = (ActionListener) invocationOnMock.getArguments()[2];
198-
listener.onResponse(new IndexResponse(null, "doc", UUIDs.randomBase64UUID(random()), randomLong(), randomLong(), 1, true));
199+
listener.onResponse(new IndexResponse(
200+
new ShardId("test", "test", 0), "doc", UUIDs.randomBase64UUID(random()), randomLong(), randomLong(), 1, true));
199201
return null;
200202
}).when(client).execute(Mockito.same(IndexAction.INSTANCE), any(IndexRequest.class), any(ActionListener.class));
201203
final PlainActionFuture<CreateApiKeyResponse> future = new PlainActionFuture();

0 commit comments

Comments
 (0)