From 3827a83c0b065d8ffdee24952a7e4c117f002118 Mon Sep 17 00:00:00 2001 From: Matt Peterson Date: Fri, 23 Aug 2024 10:30:47 -0600 Subject: [PATCH] fix: refactored to fromPbj Signed-off-by: Matt Peterson --- .../src/main/java/com/hedera/block/server/Translator.java | 7 ++----- .../block/server/BlockStreamServiceIntegrationTest.java | 3 +-- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/server/src/main/java/com/hedera/block/server/Translator.java b/server/src/main/java/com/hedera/block/server/Translator.java index 74a729848..ec98baeef 100644 --- a/server/src/main/java/com/hedera/block/server/Translator.java +++ b/server/src/main/java/com/hedera/block/server/Translator.java @@ -145,11 +145,8 @@ public static com.hedera.hapi.block.protoc.SubscribeStreamResponse fromPbj( * @return the converted {@link com.hedera.hapi.block.protoc.SubscribeStreamRequest} */ @NonNull - public static com.hedera.hapi.block.protoc.SubscribeStreamRequest - toProtocSubscribeStreamRequest( - @NonNull - final com.hedera.hapi.block.SubscribeStreamRequest - subscribeStreamRequest) { + public static com.hedera.hapi.block.protoc.SubscribeStreamRequest fromPbj( + @NonNull final com.hedera.hapi.block.SubscribeStreamRequest subscribeStreamRequest) { try { final byte[] pbjBytes = asBytes(SubscribeStreamRequest.PROTOBUF, subscribeStreamRequest); diff --git a/server/src/test/java/com/hedera/block/server/BlockStreamServiceIntegrationTest.java b/server/src/test/java/com/hedera/block/server/BlockStreamServiceIntegrationTest.java index fa572f059..afe27cd51 100644 --- a/server/src/test/java/com/hedera/block/server/BlockStreamServiceIntegrationTest.java +++ b/server/src/test/java/com/hedera/block/server/BlockStreamServiceIntegrationTest.java @@ -17,7 +17,6 @@ package com.hedera.block.server; import static com.hedera.block.server.Translator.fromPbj; -import static com.hedera.block.server.Translator.toProtocSubscribeStreamRequest; import static com.hedera.block.server.producer.Util.getFakeHash; import static com.hedera.block.server.util.PersistTestUtils.generateBlockItems; import static java.lang.System.Logger; @@ -511,7 +510,7 @@ public void testMediatorExceptionHandlingWhenPersistenceFailure() SubscribeStreamRequest.newBuilder().startBlockNumber(1).build(); // Simulate a consumer attempting to connect to the Block Node after the exception. blockStreamService.protocSubscribeBlockStream( - toProtocSubscribeStreamRequest(subscribeStreamRequest), subscribeStreamObserver4); + fromPbj(subscribeStreamRequest), subscribeStreamObserver4); // The BlockItem passed through since it was published // before the IOException was thrown.