From 1e0cf3e6a4930cfaa902cccdd9c15ff2ba5fc276 Mon Sep 17 00:00:00 2001 From: Matthias Fischer Date: Tue, 30 Jul 2024 01:09:30 +0200 Subject: [PATCH] chore(quality): [#841] simplify string construction --- .../tractusx/irs/component/TombstoneTest.java | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/irs-api/src/test/java/org/eclipse/tractusx/irs/component/TombstoneTest.java b/irs-api/src/test/java/org/eclipse/tractusx/irs/component/TombstoneTest.java index 0d9b0ef72..c62e5d8b5 100644 --- a/irs-api/src/test/java/org/eclipse/tractusx/irs/component/TombstoneTest.java +++ b/irs-api/src/test/java/org/eclipse/tractusx/irs/component/TombstoneTest.java @@ -128,18 +128,8 @@ void shouldUseExceptionMessageWhenSuppressedExceptionNotPresent() { } private String zonedDateTimeExcerpt(ZonedDateTime dateTime) { - return new StringBuilder().append(dateTime.getYear()) - .append("-") - .append(dateTime.getMonth()) - .append("-") - .append(dateTime.getDayOfMonth()) - .append("T") - .append(dateTime.getHour()) - .append(":") - .append(dateTime.getMinute()) - .append(":") - .append(dateTime.getSecond()) - .toString(); + return "%d-%s-%dT%d:%d:%d".formatted(dateTime.getYear(), dateTime.getMonth(), dateTime.getDayOfMonth(), + dateTime.getHour(), dateTime.getMinute(), dateTime.getSecond()); } }