|
|
|
|
@@ -22,7 +22,6 @@ using StellaOps.Concelier.Connector.Common.Cursors;
|
|
|
|
|
using StellaOps.Concelier.Connector.Common.Http;
|
|
|
|
|
using StellaOps.Concelier.Connector.Common.Testing;
|
|
|
|
|
using StellaOps.Concelier.Storage;
|
|
|
|
|
using StellaOps.Concelier.Storage;
|
|
|
|
|
using StellaOps.Concelier.Storage.Advisories;
|
|
|
|
|
using StellaOps.Concelier.Testing;
|
|
|
|
|
using Xunit;
|
|
|
|
|
@@ -135,8 +134,9 @@ public sealed class CertCcConnectorTests : IAsyncLifetime
|
|
|
|
|
var stateRepository = provider.GetRequiredService<ISourceStateRepository>();
|
|
|
|
|
var state = await stateRepository.TryGetAsync(CertCcConnectorPlugin.SourceName, CancellationToken.None);
|
|
|
|
|
state.Should().NotBeNull();
|
|
|
|
|
state!.Cursor.Should().NotBeNull();
|
|
|
|
|
var pendingNotesCount = state.Cursor.TryGetValue("pendingNotes", out var pendingNotesValue)
|
|
|
|
|
var stateValue = state!;
|
|
|
|
|
stateValue.Cursor.Should().NotBeNull();
|
|
|
|
|
var pendingNotesCount = stateValue.Cursor.TryGetValue("pendingNotes", out var pendingNotesValue)
|
|
|
|
|
? pendingNotesValue!.AsDocumentArray.Count
|
|
|
|
|
: 0;
|
|
|
|
|
pendingNotesCount.Should().Be(0);
|
|
|
|
|
@@ -216,10 +216,11 @@ public sealed class CertCcConnectorTests : IAsyncLifetime
|
|
|
|
|
var stateRepository = provider.GetRequiredService<ISourceStateRepository>();
|
|
|
|
|
var state = await stateRepository.TryGetAsync(CertCcConnectorPlugin.SourceName, CancellationToken.None);
|
|
|
|
|
state.Should().NotBeNull();
|
|
|
|
|
state!.FailCount.Should().BeGreaterThan(0);
|
|
|
|
|
state.BackoffUntil.Should().NotBeNull();
|
|
|
|
|
state.BackoffUntil.Should().BeAfter(_timeProvider.GetUtcNow());
|
|
|
|
|
state.Cursor.TryGetValue("pendingNotes", out var pendingNotesValue).Should().BeTrue();
|
|
|
|
|
var stateValue = state!;
|
|
|
|
|
stateValue.FailCount.Should().BeGreaterThan(0);
|
|
|
|
|
stateValue.BackoffUntil.Should().NotBeNull();
|
|
|
|
|
stateValue.BackoffUntil.Should().BeAfter(_timeProvider.GetUtcNow());
|
|
|
|
|
stateValue.Cursor.TryGetValue("pendingNotes", out var pendingNotesValue).Should().BeTrue();
|
|
|
|
|
pendingNotesValue!.AsDocumentArray.Should().Contain(value => value.AsString == "294418");
|
|
|
|
|
var pendingSummaries = state.Cursor.TryGetValue("pendingSummaries", out var pendingSummariesValue)
|
|
|
|
|
? pendingSummariesValue!.AsDocumentArray.Count
|
|
|
|
|
@@ -259,11 +260,12 @@ public sealed class CertCcConnectorTests : IAsyncLifetime
|
|
|
|
|
var stateRepository = provider.GetRequiredService<ISourceStateRepository>();
|
|
|
|
|
var state = await stateRepository.TryGetAsync(CertCcConnectorPlugin.SourceName, CancellationToken.None);
|
|
|
|
|
state.Should().NotBeNull();
|
|
|
|
|
state!.Cursor.TryGetValue("pendingNotes", out var pendingNotesValue).Should().BeTrue();
|
|
|
|
|
var stateValue = state!;
|
|
|
|
|
stateValue.Cursor.TryGetValue("pendingNotes", out var pendingNotesValue).Should().BeTrue();
|
|
|
|
|
pendingNotesValue!.AsDocumentArray.Should().BeEmpty();
|
|
|
|
|
state.Cursor.TryGetValue("pendingDocuments", out var pendingDocsValue).Should().BeTrue();
|
|
|
|
|
stateValue.Cursor.TryGetValue("pendingDocuments", out var pendingDocsValue).Should().BeTrue();
|
|
|
|
|
pendingDocsValue!.AsDocumentArray.Should().BeEmpty();
|
|
|
|
|
state.Cursor.TryGetValue("pendingMappings", out var pendingMappingsValue).Should().BeTrue();
|
|
|
|
|
stateValue.Cursor.TryGetValue("pendingMappings", out var pendingMappingsValue).Should().BeTrue();
|
|
|
|
|
pendingMappingsValue!.AsDocumentArray.Should().BeEmpty();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -298,11 +300,12 @@ public sealed class CertCcConnectorTests : IAsyncLifetime
|
|
|
|
|
var stateRepository = provider.GetRequiredService<ISourceStateRepository>();
|
|
|
|
|
var state = await stateRepository.TryGetAsync(CertCcConnectorPlugin.SourceName, CancellationToken.None);
|
|
|
|
|
state.Should().NotBeNull();
|
|
|
|
|
var pendingDocuments = state!.Cursor.TryGetValue("pendingDocuments", out var pendingDocsValue)
|
|
|
|
|
var stateValue = state!;
|
|
|
|
|
var pendingDocuments = stateValue.Cursor.TryGetValue("pendingDocuments", out var pendingDocsValue)
|
|
|
|
|
? pendingDocsValue!.AsDocumentArray.Count
|
|
|
|
|
: 0;
|
|
|
|
|
pendingDocuments.Should().BeGreaterThan(0);
|
|
|
|
|
var pendingMappings = state.Cursor.TryGetValue("pendingMappings", out var pendingMappingsValue)
|
|
|
|
|
var pendingMappings = stateValue.Cursor.TryGetValue("pendingMappings", out var pendingMappingsValue)
|
|
|
|
|
? pendingMappingsValue!.AsDocumentArray.Count
|
|
|
|
|
: 0;
|
|
|
|
|
pendingMappings.Should().Be(0);
|
|
|
|
|
|