From aabe5d845bdb77426feb2925d0e4ef531349f56f Mon Sep 17 00:00:00 2001 From: acn-dgopa Date: Sun, 8 Dec 2024 21:06:24 +0100 Subject: [PATCH 1/2] the end date is set to 1st of next month as the upperbound is excluded --- .../AuthenticationEventRepository.cs | 2 +- .../AuthorizationEventRepository.cs | 2 +- .../Migration/v0.03/01-setup-tables.sql | 60 +++++++++++++++++++ .../PartitionManagerRepository.cs | 2 +- .../PartitionCreationHostedService.cs | 8 +-- ...onCreationHostedServiceIntegrationTests.cs | 2 +- .../PartitionCreationHosterServiceTests.cs | 18 +++--- 7 files changed, 77 insertions(+), 17 deletions(-) create mode 100644 src/Altinn.Auth.AuditLog.Persistence/Migration/v0.03/01-setup-tables.sql diff --git a/src/Altinn.Auth.AuditLog.Persistence/AuthenticationEventRepository.cs b/src/Altinn.Auth.AuditLog.Persistence/AuthenticationEventRepository.cs index 27aeb4d..482d9bf 100644 --- a/src/Altinn.Auth.AuditLog.Persistence/AuthenticationEventRepository.cs +++ b/src/Altinn.Auth.AuditLog.Persistence/AuthenticationEventRepository.cs @@ -29,7 +29,7 @@ public async Task InsertAuthenticationEvent(AuthenticationEvent authenticationEv { const string INSERTAUTHNEVENT = /*strpsql*/ """ - INSERT INTO authentication.eventlogv1 ( + INSERT INTO authentication.eventlogv2 ( sessionid, externalsessionid, subscriptionkey, diff --git a/src/Altinn.Auth.AuditLog.Persistence/AuthorizationEventRepository.cs b/src/Altinn.Auth.AuditLog.Persistence/AuthorizationEventRepository.cs index c8dd7fd..cce40bd 100644 --- a/src/Altinn.Auth.AuditLog.Persistence/AuthorizationEventRepository.cs +++ b/src/Altinn.Auth.AuditLog.Persistence/AuthorizationEventRepository.cs @@ -29,7 +29,7 @@ public async Task InsertAuthorizationEvent(AuthorizationEvent authorizationEvent { const string INSERTAUTHZEVENT = /*strpsql*/ """ - INSERT INTO authz.eventlogv1( + INSERT INTO authz.eventlogv2( sessionid, created, subjectuserid, diff --git a/src/Altinn.Auth.AuditLog.Persistence/Migration/v0.03/01-setup-tables.sql b/src/Altinn.Auth.AuditLog.Persistence/Migration/v0.03/01-setup-tables.sql new file mode 100644 index 0000000..3d3835f --- /dev/null +++ b/src/Altinn.Auth.AuditLog.Persistence/Migration/v0.03/01-setup-tables.sql @@ -0,0 +1,60 @@ + +-- Table: authentication.eventlogv2 +CREATE TABLE IF NOT EXISTS authentication.eventlogv2 +( + sessionid text, + externalsessionid text, + subscriptionkey text, + externaltokenissuer text, + created timestamp with time zone NOT NULL, + userid integer, + supplierid text, + orgnumber integer, + eventtypeid integer, + authenticationmethodid integer, + authenticationlevelid integer, + ipaddress text, + isauthenticated boolean NOT NULL, + CONSTRAINT authenticationeventtype_fkey FOREIGN KEY (eventtypeid) + REFERENCES authentication.authenticationeventtype (authenticationeventtypeid) MATCH SIMPLE + ON UPDATE NO ACTION + ON DELETE NO ACTION + NOT VALID, + CONSTRAINT authenticationlevel_fkey FOREIGN KEY (authenticationlevelid) + REFERENCES authentication.authenticationlevel (authenticationlevelid) MATCH SIMPLE + ON UPDATE NO ACTION + ON DELETE NO ACTION + NOT VALID, + CONSTRAINT authenticationmethod_fkey FOREIGN KEY (authenticationmethodid) + REFERENCES authentication.authenticationmethod (authenticationmethodid) MATCH SIMPLE + ON UPDATE NO ACTION + ON DELETE NO ACTION + NOT VALID +) PARTITION BY RANGE (created); + +CREATE INDEX ON authentication.eventlogv2 (created); + +-- Table: authz.eventlogv2 +CREATE TABLE IF NOT EXISTS authz.eventlogv2 +( + sessionid text, + created timestamp with time zone NOT NULL, + subjectuserid INTEGER, + subjectorgcode text, + subjectorgnumber INTEGER, + subjectparty INTEGER, + resourcepartyid INTEGER, + resource text, + instanceid text, + operation text, + ipaddress text, + contextrequestjson jsonb, + decision integer, + CONSTRAINT authzdecisionid_fkey FOREIGN KEY (decision) + REFERENCES authz.decision (decisionid) MATCH SIMPLE + ON UPDATE NO ACTION + ON DELETE NO ACTION + NOT VALID +) PARTITION BY RANGE (created); + +CREATE INDEX ON authz.eventlogv2 (created); diff --git a/src/Altinn.Auth.AuditLog.Persistence/PartitionManagerRepository.cs b/src/Altinn.Auth.AuditLog.Persistence/PartitionManagerRepository.cs index 67ea833..e79384a 100644 --- a/src/Altinn.Auth.AuditLog.Persistence/PartitionManagerRepository.cs +++ b/src/Altinn.Auth.AuditLog.Persistence/PartitionManagerRepository.cs @@ -50,7 +50,7 @@ public async Task CreatePartitions(IReadOnlyList partitions, Cancella var cmd = batch.CreateBatchCommand(); cmd.CommandText = /*strpsql*/$""" CREATE TABLE IF NOT EXISTS {partition.SchemaName}.{partition.Name} - PARTITION OF {partition.SchemaName}.eventlogv1 + PARTITION OF {partition.SchemaName}.eventlogv2 FOR VALUES FROM ('{partition.StartDate:yyyy-MM-dd}') TO ('{partition.EndDate:yyyy-MM-dd}') """; batch.BatchCommands.Add(cmd); diff --git a/src/Altinn.Auth.AuditLog/Services/PartitionCreationHostedService.cs b/src/Altinn.Auth.AuditLog/Services/PartitionCreationHostedService.cs index 3645a34..825f78b 100644 --- a/src/Altinn.Auth.AuditLog/Services/PartitionCreationHostedService.cs +++ b/src/Altinn.Auth.AuditLog/Services/PartitionCreationHostedService.cs @@ -143,9 +143,9 @@ internal IReadOnlyList GetPartitionsForCurrentAndAdjacentMonths() var (nextMonthStartDate, nextMonthEndDate) = GetMonthStartAndEndDate(now.AddMonths(1)); // Create partition names - var pastMonthPartitionName = $"eventlogv1_y{pastMonthStartDate.Year}m{pastMonthStartDate.Month:D2}"; - var currentMonthPartitionName = $"eventlogv1_y{currentMonthStartDate.Year}m{currentMonthStartDate.Month:D2}"; - var nextMonthPartitionName = $"eventlogv1_y{nextMonthStartDate.Year}m{nextMonthStartDate.Month:D2}"; + var pastMonthPartitionName = $"eventlogv2_y{pastMonthStartDate.Year}m{pastMonthStartDate.Month:D2}"; + var currentMonthPartitionName = $"eventlogv2_y{currentMonthStartDate.Year}m{currentMonthStartDate.Month:D2}"; + var nextMonthPartitionName = $"eventlogv2_y{nextMonthStartDate.Year}m{nextMonthStartDate.Month:D2}"; // List of partitions for both schemas return new List @@ -162,7 +162,7 @@ internal IReadOnlyList GetPartitionsForCurrentAndAdjacentMonths() internal (DateOnly startDate, DateOnly endDate) GetMonthStartAndEndDate(DateOnly date) { DateOnly startDate = new DateOnly(date.Year, date.Month, 1); - DateOnly endDate = startDate.AddMonths(1).AddDays(-1); + DateOnly endDate = startDate.AddMonths(1); return (startDate, endDate); } } diff --git a/test/Altinn.Auth.AuditLog.Tests/Integration/PartitionCreationHostedServiceIntegrationTests.cs b/test/Altinn.Auth.AuditLog.Tests/Integration/PartitionCreationHostedServiceIntegrationTests.cs index ffa9805..d53e36b 100644 --- a/test/Altinn.Auth.AuditLog.Tests/Integration/PartitionCreationHostedServiceIntegrationTests.cs +++ b/test/Altinn.Auth.AuditLog.Tests/Integration/PartitionCreationHostedServiceIntegrationTests.cs @@ -39,7 +39,7 @@ public async Task ExecuteAsync_CreatesCurrentMonthPartition_OnlyOnce() var currentDate = DateOnly.FromDateTime(TimeProvider.GetUtcNow().UtcDateTime); var currentMonth = currentDate.Month; var currentYear = currentDate.Year; - var partitionName = $"eventlogv1_y{currentYear}m{currentMonth:D2}"; + var partitionName = $"eventlogv2_y{currentYear}m{currentMonth:D2}"; var checkAuthenticationPartitionCommand = $"SELECT EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema='authentication' and table_name='{partitionName}');"; await using NpgsqlCommand pgcom = DataSource.CreateCommand(checkAuthenticationPartitionCommand); diff --git a/test/Altinn.Auth.AuditLog.Tests/PartitionCreationHosterServiceTests.cs b/test/Altinn.Auth.AuditLog.Tests/PartitionCreationHosterServiceTests.cs index 934da50..bbd8a1d 100644 --- a/test/Altinn.Auth.AuditLog.Tests/PartitionCreationHosterServiceTests.cs +++ b/test/Altinn.Auth.AuditLog.Tests/PartitionCreationHosterServiceTests.cs @@ -20,15 +20,15 @@ public void GetPartitionsForCurrentAndAdjacentMonths_ReturnsCorrectPartitions() // Assert Assert.Equal(6, partitions.Count); - Assert.Contains(partitions, p => p.Name == "eventlogv1_y2023m09" && p.StartDate == new DateOnly(2023, 9, 1) && p.EndDate == new DateOnly(2023, 9, 30)); - Assert.Contains(partitions, p => p.Name == "eventlogv1_y2023m10" && p.StartDate == new DateOnly(2023, 10, 1) && p.EndDate == new DateOnly(2023, 10, 31)); - Assert.Contains(partitions, p => p.Name == "eventlogv1_y2023m11" && p.StartDate == new DateOnly(2023, 11, 1) && p.EndDate == new DateOnly(2023, 11, 30)); + Assert.Contains(partitions, p => p.Name == "eventlogv2_y2023m09" && p.StartDate == new DateOnly(2023, 9, 1) && p.EndDate == new DateOnly(2023, 10, 1)); + Assert.Contains(partitions, p => p.Name == "eventlogv2_y2023m10" && p.StartDate == new DateOnly(2023, 10, 1) && p.EndDate == new DateOnly(2023, 11, 1)); + Assert.Contains(partitions, p => p.Name == "eventlogv2_y2023m11" && p.StartDate == new DateOnly(2023, 11, 1) && p.EndDate == new DateOnly(2023, 12, 1)); } [Theory] - [InlineData(2023, 10, 15, 2023, 10, 1, 2023, 10, 31)] - [InlineData(2023, 2, 1, 2023, 2, 1, 2023, 2, 28)] - [InlineData(2024, 2, 1, 2024, 2, 1, 2024, 2, 29)] // Leap year + [InlineData(2023, 10, 15, 2023, 10, 1, 2023, 11, 1)] + [InlineData(2023, 2, 1, 2023, 2, 1, 2023, 3, 1)] + [InlineData(2024, 2, 1, 2024, 2, 1, 2024, 3, 1)] public void GetMonthStartAndEndDate_ReturnsCorrectDates(int year, int month, int day, int expectedStartYear, int expectedStartMonth, int expectedStartDay, int expectedEndYear, int expectedEndMonth, int expectedEndDay) { // Arrange @@ -55,8 +55,8 @@ public void GetPartitionsForCurrentAndAdjacentMonths_CrossYearBoundary_ReturnsCo // Assert Assert.Equal(6, partitions.Count); - Assert.Contains(partitions, p => p.Name == "eventlogv1_y2023m11" && p.StartDate == new DateOnly(2023, 11, 1) && p.EndDate == new DateOnly(2023, 11, 30)); - Assert.Contains(partitions, p => p.Name == "eventlogv1_y2023m12" && p.StartDate == new DateOnly(2023, 12, 1) && p.EndDate == new DateOnly(2023, 12, 31)); - Assert.Contains(partitions, p => p.Name == "eventlogv1_y2024m01" && p.StartDate == new DateOnly(2024, 1, 1) && p.EndDate == new DateOnly(2024, 1, 31)); + Assert.Contains(partitions, p => p.Name == "eventlogv2_y2023m11" && p.StartDate == new DateOnly(2023, 11, 1) && p.EndDate == new DateOnly(2023, 12, 1)); + Assert.Contains(partitions, p => p.Name == "eventlogv2_y2023m12" && p.StartDate == new DateOnly(2023, 12, 1) && p.EndDate == new DateOnly(2024, 1, 1)); + Assert.Contains(partitions, p => p.Name == "eventlogv2_y2024m01" && p.StartDate == new DateOnly(2024, 1, 1) && p.EndDate == new DateOnly(2024, 2, 1)); } } From a7f1ca6e29ef8a8e05640246f33c8dbbc6256b74 Mon Sep 17 00:00:00 2001 From: acn-dgopa Date: Mon, 9 Dec 2024 20:58:05 +0100 Subject: [PATCH 2/2] Remove the script for eventlogv2 table and rollback to eventlogv1 --- .../AuthenticationEventRepository.cs | 2 +- .../AuthorizationEventRepository.cs | 2 +- .../Migration/v0.03/01-setup-tables.sql | 60 ------------------- .../PartitionManagerRepository.cs | 2 +- .../PartitionCreationHostedService.cs | 6 +- ...onCreationHostedServiceIntegrationTests.cs | 2 +- .../PartitionCreationHosterServiceTests.cs | 12 ++-- 7 files changed, 13 insertions(+), 73 deletions(-) delete mode 100644 src/Altinn.Auth.AuditLog.Persistence/Migration/v0.03/01-setup-tables.sql diff --git a/src/Altinn.Auth.AuditLog.Persistence/AuthenticationEventRepository.cs b/src/Altinn.Auth.AuditLog.Persistence/AuthenticationEventRepository.cs index 482d9bf..27aeb4d 100644 --- a/src/Altinn.Auth.AuditLog.Persistence/AuthenticationEventRepository.cs +++ b/src/Altinn.Auth.AuditLog.Persistence/AuthenticationEventRepository.cs @@ -29,7 +29,7 @@ public async Task InsertAuthenticationEvent(AuthenticationEvent authenticationEv { const string INSERTAUTHNEVENT = /*strpsql*/ """ - INSERT INTO authentication.eventlogv2 ( + INSERT INTO authentication.eventlogv1 ( sessionid, externalsessionid, subscriptionkey, diff --git a/src/Altinn.Auth.AuditLog.Persistence/AuthorizationEventRepository.cs b/src/Altinn.Auth.AuditLog.Persistence/AuthorizationEventRepository.cs index cce40bd..c8dd7fd 100644 --- a/src/Altinn.Auth.AuditLog.Persistence/AuthorizationEventRepository.cs +++ b/src/Altinn.Auth.AuditLog.Persistence/AuthorizationEventRepository.cs @@ -29,7 +29,7 @@ public async Task InsertAuthorizationEvent(AuthorizationEvent authorizationEvent { const string INSERTAUTHZEVENT = /*strpsql*/ """ - INSERT INTO authz.eventlogv2( + INSERT INTO authz.eventlogv1( sessionid, created, subjectuserid, diff --git a/src/Altinn.Auth.AuditLog.Persistence/Migration/v0.03/01-setup-tables.sql b/src/Altinn.Auth.AuditLog.Persistence/Migration/v0.03/01-setup-tables.sql deleted file mode 100644 index 3d3835f..0000000 --- a/src/Altinn.Auth.AuditLog.Persistence/Migration/v0.03/01-setup-tables.sql +++ /dev/null @@ -1,60 +0,0 @@ - --- Table: authentication.eventlogv2 -CREATE TABLE IF NOT EXISTS authentication.eventlogv2 -( - sessionid text, - externalsessionid text, - subscriptionkey text, - externaltokenissuer text, - created timestamp with time zone NOT NULL, - userid integer, - supplierid text, - orgnumber integer, - eventtypeid integer, - authenticationmethodid integer, - authenticationlevelid integer, - ipaddress text, - isauthenticated boolean NOT NULL, - CONSTRAINT authenticationeventtype_fkey FOREIGN KEY (eventtypeid) - REFERENCES authentication.authenticationeventtype (authenticationeventtypeid) MATCH SIMPLE - ON UPDATE NO ACTION - ON DELETE NO ACTION - NOT VALID, - CONSTRAINT authenticationlevel_fkey FOREIGN KEY (authenticationlevelid) - REFERENCES authentication.authenticationlevel (authenticationlevelid) MATCH SIMPLE - ON UPDATE NO ACTION - ON DELETE NO ACTION - NOT VALID, - CONSTRAINT authenticationmethod_fkey FOREIGN KEY (authenticationmethodid) - REFERENCES authentication.authenticationmethod (authenticationmethodid) MATCH SIMPLE - ON UPDATE NO ACTION - ON DELETE NO ACTION - NOT VALID -) PARTITION BY RANGE (created); - -CREATE INDEX ON authentication.eventlogv2 (created); - --- Table: authz.eventlogv2 -CREATE TABLE IF NOT EXISTS authz.eventlogv2 -( - sessionid text, - created timestamp with time zone NOT NULL, - subjectuserid INTEGER, - subjectorgcode text, - subjectorgnumber INTEGER, - subjectparty INTEGER, - resourcepartyid INTEGER, - resource text, - instanceid text, - operation text, - ipaddress text, - contextrequestjson jsonb, - decision integer, - CONSTRAINT authzdecisionid_fkey FOREIGN KEY (decision) - REFERENCES authz.decision (decisionid) MATCH SIMPLE - ON UPDATE NO ACTION - ON DELETE NO ACTION - NOT VALID -) PARTITION BY RANGE (created); - -CREATE INDEX ON authz.eventlogv2 (created); diff --git a/src/Altinn.Auth.AuditLog.Persistence/PartitionManagerRepository.cs b/src/Altinn.Auth.AuditLog.Persistence/PartitionManagerRepository.cs index e79384a..67ea833 100644 --- a/src/Altinn.Auth.AuditLog.Persistence/PartitionManagerRepository.cs +++ b/src/Altinn.Auth.AuditLog.Persistence/PartitionManagerRepository.cs @@ -50,7 +50,7 @@ public async Task CreatePartitions(IReadOnlyList partitions, Cancella var cmd = batch.CreateBatchCommand(); cmd.CommandText = /*strpsql*/$""" CREATE TABLE IF NOT EXISTS {partition.SchemaName}.{partition.Name} - PARTITION OF {partition.SchemaName}.eventlogv2 + PARTITION OF {partition.SchemaName}.eventlogv1 FOR VALUES FROM ('{partition.StartDate:yyyy-MM-dd}') TO ('{partition.EndDate:yyyy-MM-dd}') """; batch.BatchCommands.Add(cmd); diff --git a/src/Altinn.Auth.AuditLog/Services/PartitionCreationHostedService.cs b/src/Altinn.Auth.AuditLog/Services/PartitionCreationHostedService.cs index 825f78b..bcdf9e8 100644 --- a/src/Altinn.Auth.AuditLog/Services/PartitionCreationHostedService.cs +++ b/src/Altinn.Auth.AuditLog/Services/PartitionCreationHostedService.cs @@ -143,9 +143,9 @@ internal IReadOnlyList GetPartitionsForCurrentAndAdjacentMonths() var (nextMonthStartDate, nextMonthEndDate) = GetMonthStartAndEndDate(now.AddMonths(1)); // Create partition names - var pastMonthPartitionName = $"eventlogv2_y{pastMonthStartDate.Year}m{pastMonthStartDate.Month:D2}"; - var currentMonthPartitionName = $"eventlogv2_y{currentMonthStartDate.Year}m{currentMonthStartDate.Month:D2}"; - var nextMonthPartitionName = $"eventlogv2_y{nextMonthStartDate.Year}m{nextMonthStartDate.Month:D2}"; + var pastMonthPartitionName = $"eventlogv1_y{pastMonthStartDate.Year}m{pastMonthStartDate.Month:D2}"; + var currentMonthPartitionName = $"eventlogv1_y{currentMonthStartDate.Year}m{currentMonthStartDate.Month:D2}"; + var nextMonthPartitionName = $"eventlogv1_y{nextMonthStartDate.Year}m{nextMonthStartDate.Month:D2}"; // List of partitions for both schemas return new List diff --git a/test/Altinn.Auth.AuditLog.Tests/Integration/PartitionCreationHostedServiceIntegrationTests.cs b/test/Altinn.Auth.AuditLog.Tests/Integration/PartitionCreationHostedServiceIntegrationTests.cs index d53e36b..ffa9805 100644 --- a/test/Altinn.Auth.AuditLog.Tests/Integration/PartitionCreationHostedServiceIntegrationTests.cs +++ b/test/Altinn.Auth.AuditLog.Tests/Integration/PartitionCreationHostedServiceIntegrationTests.cs @@ -39,7 +39,7 @@ public async Task ExecuteAsync_CreatesCurrentMonthPartition_OnlyOnce() var currentDate = DateOnly.FromDateTime(TimeProvider.GetUtcNow().UtcDateTime); var currentMonth = currentDate.Month; var currentYear = currentDate.Year; - var partitionName = $"eventlogv2_y{currentYear}m{currentMonth:D2}"; + var partitionName = $"eventlogv1_y{currentYear}m{currentMonth:D2}"; var checkAuthenticationPartitionCommand = $"SELECT EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema='authentication' and table_name='{partitionName}');"; await using NpgsqlCommand pgcom = DataSource.CreateCommand(checkAuthenticationPartitionCommand); diff --git a/test/Altinn.Auth.AuditLog.Tests/PartitionCreationHosterServiceTests.cs b/test/Altinn.Auth.AuditLog.Tests/PartitionCreationHosterServiceTests.cs index bbd8a1d..1118522 100644 --- a/test/Altinn.Auth.AuditLog.Tests/PartitionCreationHosterServiceTests.cs +++ b/test/Altinn.Auth.AuditLog.Tests/PartitionCreationHosterServiceTests.cs @@ -20,9 +20,9 @@ public void GetPartitionsForCurrentAndAdjacentMonths_ReturnsCorrectPartitions() // Assert Assert.Equal(6, partitions.Count); - Assert.Contains(partitions, p => p.Name == "eventlogv2_y2023m09" && p.StartDate == new DateOnly(2023, 9, 1) && p.EndDate == new DateOnly(2023, 10, 1)); - Assert.Contains(partitions, p => p.Name == "eventlogv2_y2023m10" && p.StartDate == new DateOnly(2023, 10, 1) && p.EndDate == new DateOnly(2023, 11, 1)); - Assert.Contains(partitions, p => p.Name == "eventlogv2_y2023m11" && p.StartDate == new DateOnly(2023, 11, 1) && p.EndDate == new DateOnly(2023, 12, 1)); + Assert.Contains(partitions, p => p.Name == "eventlogv1_y2023m09" && p.StartDate == new DateOnly(2023, 9, 1) && p.EndDate == new DateOnly(2023, 10, 1)); + Assert.Contains(partitions, p => p.Name == "eventlogv1_y2023m10" && p.StartDate == new DateOnly(2023, 10, 1) && p.EndDate == new DateOnly(2023, 11, 1)); + Assert.Contains(partitions, p => p.Name == "eventlogv1_y2023m11" && p.StartDate == new DateOnly(2023, 11, 1) && p.EndDate == new DateOnly(2023, 12, 1)); } [Theory] @@ -55,8 +55,8 @@ public void GetPartitionsForCurrentAndAdjacentMonths_CrossYearBoundary_ReturnsCo // Assert Assert.Equal(6, partitions.Count); - Assert.Contains(partitions, p => p.Name == "eventlogv2_y2023m11" && p.StartDate == new DateOnly(2023, 11, 1) && p.EndDate == new DateOnly(2023, 12, 1)); - Assert.Contains(partitions, p => p.Name == "eventlogv2_y2023m12" && p.StartDate == new DateOnly(2023, 12, 1) && p.EndDate == new DateOnly(2024, 1, 1)); - Assert.Contains(partitions, p => p.Name == "eventlogv2_y2024m01" && p.StartDate == new DateOnly(2024, 1, 1) && p.EndDate == new DateOnly(2024, 2, 1)); + Assert.Contains(partitions, p => p.Name == "eventlogv1_y2023m11" && p.StartDate == new DateOnly(2023, 11, 1) && p.EndDate == new DateOnly(2023, 12, 1)); + Assert.Contains(partitions, p => p.Name == "eventlogv1_y2023m12" && p.StartDate == new DateOnly(2023, 12, 1) && p.EndDate == new DateOnly(2024, 1, 1)); + Assert.Contains(partitions, p => p.Name == "eventlogv1_y2024m01" && p.StartDate == new DateOnly(2024, 1, 1) && p.EndDate == new DateOnly(2024, 2, 1)); } }