Skip to content

Commit 4dcd1f6

Browse files
codebrainrusscam
authored andcommitted
Fix build
1 parent d23925a commit 4dcd1f6

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/Tests/Tests/XPack/Security/ApiKey/SecurityApiKeyUsageTests.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ protected override Func<NodesInfoDescriptor, INodesInfoRequest> Fluent
3333
get
3434
{
3535
TryGetExtendedValue<CreateApiKeyResponse>("response", out var response);
36+
37+
// Unit tests for HitsTheCorrectUrl will have a null response object.
38+
if (response == null)
39+
return d => d;
40+
3641
return d => d.RequestConfiguration(r => r.ApiKeyAuthentication(response.Id, response.ApiKey));
3742
}
3843
}
@@ -46,6 +51,11 @@ protected override NodesInfoRequest Initializer
4651
get
4752
{
4853
TryGetExtendedValue<CreateApiKeyResponse>("response", out var response);
54+
55+
// Unit tests for HitsTheCorrectUrl will have a null response object.
56+
if (response == null)
57+
return new NodesInfoRequest();
58+
4959
return new NodesInfoRequest
5060
{
5161
RequestConfiguration = new RequestConfiguration

0 commit comments

Comments
 (0)