From 93c2c0670b03a7160c06e40bfb43279cf42af4c8 Mon Sep 17 00:00:00 2001 From: Atanas Atanasov Date: Tue, 12 Nov 2024 17:01:36 +0200 Subject: [PATCH] addressing pr comment Signed-off-by: Atanas Atanasov --- .../java/com/hedera/block/server/mediator/MediatorConfig.java | 4 ++-- .../java/com/hedera/block/server/notifier/NotifierConfig.java | 4 ++-- .../com/hedera/block/server/mediator/MediatorConfigTest.java | 4 ++-- .../com/hedera/block/server/notifier/NotifierConfigTest.java | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/server/src/main/java/com/hedera/block/server/mediator/MediatorConfig.java b/server/src/main/java/com/hedera/block/server/mediator/MediatorConfig.java index 823ad5ae..6c2f939e 100644 --- a/server/src/main/java/com/hedera/block/server/mediator/MediatorConfig.java +++ b/server/src/main/java/com/hedera/block/server/mediator/MediatorConfig.java @@ -44,8 +44,8 @@ public record MediatorConfig( * @throws IllegalArgumentException if the configuration is invalid */ public MediatorConfig { - Preconditions.requirePositive(ringBufferSize, "Mediator Ring Buffer Size must be positive!"); - Preconditions.requirePowerOfTwo(ringBufferSize, "Mediator Ring Buffer Size must be a power of 2!"); + Preconditions.requirePositive(ringBufferSize, "Mediator Ring Buffer Size must be positive"); + Preconditions.requirePowerOfTwo(ringBufferSize, "Mediator Ring Buffer Size must be a power of 2"); LOGGER.log(INFO, "Mediator configuration mediator.ringBufferSize: " + ringBufferSize); LOGGER.log(INFO, "Mediator configuration mediator.type: " + type); } diff --git a/server/src/main/java/com/hedera/block/server/notifier/NotifierConfig.java b/server/src/main/java/com/hedera/block/server/notifier/NotifierConfig.java index e033541c..3b753d9b 100644 --- a/server/src/main/java/com/hedera/block/server/notifier/NotifierConfig.java +++ b/server/src/main/java/com/hedera/block/server/notifier/NotifierConfig.java @@ -39,8 +39,8 @@ public record NotifierConfig(@ConfigProperty(defaultValue = "1024") int ringBuff * @throws IllegalArgumentException if the configuration is invalid */ public NotifierConfig { - Preconditions.requirePositive(ringBufferSize, "Notifier Ring Buffer Size must be positive!"); - Preconditions.requirePowerOfTwo(ringBufferSize, "Notifier Ring Buffer Size must be a power of 2!"); + Preconditions.requirePositive(ringBufferSize, "Notifier Ring Buffer Size must be positive"); + Preconditions.requirePowerOfTwo(ringBufferSize, "Notifier Ring Buffer Size must be a power of 2"); LOGGER.log(INFO, "Notifier configuration notifier.ringBufferSize: " + ringBufferSize); } } diff --git a/server/src/test/java/com/hedera/block/server/mediator/MediatorConfigTest.java b/server/src/test/java/com/hedera/block/server/mediator/MediatorConfigTest.java index eb913d62..c30eadd3 100644 --- a/server/src/test/java/com/hedera/block/server/mediator/MediatorConfigTest.java +++ b/server/src/test/java/com/hedera/block/server/mediator/MediatorConfigTest.java @@ -34,7 +34,7 @@ public void testMediatorConfig_happyPath() { public void testMediatorConfig_negativeRingBufferSize() { IllegalArgumentException exception = assertThrows(IllegalArgumentException.class, () -> new MediatorConfig(-1, "")); - assertEquals("Mediator Ring Buffer Size must be positive!", exception.getMessage()); + assertEquals("Mediator Ring Buffer Size must be positive", exception.getMessage()); } @Test @@ -52,7 +52,7 @@ public void testMediatorConfig_powerOf2Values() { for (int powerOf2Value : powerOf2Values) { IllegalArgumentException exception = assertThrows(IllegalArgumentException.class, () -> new MediatorConfig(powerOf2Value + 1, "")); - assertEquals("Mediator Ring Buffer Size must be a power of 2!", exception.getMessage()); + assertEquals("Mediator Ring Buffer Size must be a power of 2", exception.getMessage()); } } } diff --git a/server/src/test/java/com/hedera/block/server/notifier/NotifierConfigTest.java b/server/src/test/java/com/hedera/block/server/notifier/NotifierConfigTest.java index 69d0add0..8852284a 100644 --- a/server/src/test/java/com/hedera/block/server/notifier/NotifierConfigTest.java +++ b/server/src/test/java/com/hedera/block/server/notifier/NotifierConfigTest.java @@ -33,7 +33,7 @@ public void testNotifierConfig_happyPath() { @Test public void testNotifierConfig_negativeRingBufferSize() { IllegalArgumentException exception = assertThrows(IllegalArgumentException.class, () -> new NotifierConfig(-1)); - assertEquals("Notifier Ring Buffer Size must be positive!", exception.getMessage()); + assertEquals("Notifier Ring Buffer Size must be positive", exception.getMessage()); } @Test @@ -50,7 +50,7 @@ public void testMediatorConfig_powerOf2Values() { for (int powerOf2Value : powerOf2Values) { IllegalArgumentException exception = assertThrows(IllegalArgumentException.class, () -> new NotifierConfig(powerOf2Value + 1)); - assertEquals("Notifier Ring Buffer Size must be a power of 2!", exception.getMessage()); + assertEquals("Notifier Ring Buffer Size must be a power of 2", exception.getMessage()); } } }