Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs-builder.slnx
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
<Folder Name="/tests-integration/">
<File Path="tests-integration/Directory.Build.props" />
<Project Path="tests-integration/Elastic.Assembler.IntegrationTests/Elastic.Assembler.IntegrationTests.csproj" />
<Project Path="tests-integration/Elastic.Documentation.Api.IntegrationTests/Elastic.Documentation.Api.IntegrationTests.csproj" />
</Folder>
<Folder Name="/tests/">
<File Path="tests/Directory.Build.props" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ public async Task AskAiEndpointPropagatatesEuidToAllSpansAndLogs()
using var request = new HttpRequestMessage(HttpMethod.Post, "/docs/_api/v1/ask-ai/stream");
request.Headers.Add("Cookie", $"euid={expectedEuid}");
request.Content = new StringContent(
"""{"message":"test question","conversationId":null}""",
/*lang=json,strict*/
"""{"message":"test question","conversationId":null}""",
Encoding.UTF8,
"application/json"
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,10 @@ protected override void ConfigureWebHost(IWebHostBuilder builder) =>
// Mock IAskAiGateway to avoid external AI service calls
var mockAskAiGateway = A.Fake<IAskAiGateway<Stream>>();
A.CallTo(() => mockAskAiGateway.AskAi(A<AskAiRequest>._, A<Cancel>._))
.ReturnsLazily(() => {
.ReturnsLazily(() =>
{
var stream = new MemoryStream(Encoding.UTF8.GetBytes("data: test\n\n"));
MockMemoryStreams.Add(stream);
_mockMemoryStreams.Add(stream);
return Task.FromResult<Stream>(stream);
});
_ = services.AddSingleton(mockAskAiGateway);
Expand All @@ -79,11 +80,11 @@ protected override void Dispose(bool disposing)
{
if (disposing)
{
foreach (var stream in MockMemoryStreams)
foreach (var stream in _mockMemoryStreams)
{
stream.Dispose();
}
MockMemoryStreams.Clear();
_mockMemoryStreams.Clear();
}
base.Dispose(disposing);
}
Expand Down
Loading