From e56ab638dce28d95e80fcb9237b6194777685786 Mon Sep 17 00:00:00 2001 From: Julian Ladisch Date: Tue, 11 Aug 2026 18:34:32 +0200 Subject: [PATCH] MODEXPW-651: Make fractional second optional in buildContext_setsCreatedAt https://folio-org.atlassian.net/browse/MODEXPW-651 OrderEmailContextMapperTest.buildContext_setsCreatedAt:177 fails in about .1 % of all runs with this error: ``` Expecting actual: "2026-08-11T15:33:47Z" to match pattern: "\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z" ``` Example: https://github.com/folio-org/mod-data-export-worker/actions/runs/31503434083/job/93819003252 Fix the expected pattern by making the fractional second optional. --- .../batch/acquisitions/mapper/OrderEmailContextMapperTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/org/folio/dew/batch/acquisitions/mapper/OrderEmailContextMapperTest.java b/src/test/java/org/folio/dew/batch/acquisitions/mapper/OrderEmailContextMapperTest.java index e27a49e0e..30451908f 100644 --- a/src/test/java/org/folio/dew/batch/acquisitions/mapper/OrderEmailContextMapperTest.java +++ b/src/test/java/org/folio/dew/batch/acquisitions/mapper/OrderEmailContextMapperTest.java @@ -173,7 +173,7 @@ void buildContext_emptyOrders_returnsEmptyList() { void buildContext_setsCreatedAt() { OrderEmailContext ctx = mapper.buildContext(List.of()); - assertThat(ctx.getCreatedAt()).matches("\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z"); + assertThat(ctx.getCreatedAt()).matches("\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d{3})?Z"); } @Test