From 7916f4214a5786dbcaf995a7918944e250356e40 Mon Sep 17 00:00:00 2001 From: Matt Peterson Date: Tue, 23 Jul 2024 11:20:02 -0600 Subject: [PATCH] spotless Signed-off-by: Matt Peterson --- .../block/server/BlockStreamServiceIT.java | 12 ++---- .../block/server/BlockStreamServiceTest.java | 42 +++++++++++++------ 2 files changed, 33 insertions(+), 21 deletions(-) diff --git a/server/src/test/java/com/hedera/block/server/BlockStreamServiceIT.java b/server/src/test/java/com/hedera/block/server/BlockStreamServiceIT.java index f788f63d5..423a8599b 100644 --- a/server/src/test/java/com/hedera/block/server/BlockStreamServiceIT.java +++ b/server/src/test/java/com/hedera/block/server/BlockStreamServiceIT.java @@ -19,12 +19,9 @@ import static com.hedera.block.protos.BlockStreamService.*; import static com.hedera.block.protos.BlockStreamService.PublishStreamResponse.ItemAcknowledgement; import static com.hedera.block.server.util.PersistTestUtils.generateBlockItems; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; -import com.google.protobuf.Descriptors; import com.hedera.block.server.data.ObjectEvent; import com.hedera.block.server.mediator.LiveStreamMediatorImpl; import com.hedera.block.server.mediator.StreamMediator; @@ -36,6 +33,9 @@ import com.hedera.block.server.producer.ItemAckBuilder; import com.hedera.block.server.util.TestUtils; import io.grpc.stub.StreamObserver; +import io.helidon.config.Config; +import io.helidon.config.MapConfigSource; +import io.helidon.config.spi.ConfigSource; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; @@ -43,10 +43,6 @@ import java.util.List; import java.util.Map; import java.util.function.Consumer; - -import io.helidon.config.Config; -import io.helidon.config.MapConfigSource; -import io.helidon.config.spi.ConfigSource; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -175,7 +171,6 @@ public void testSubscribeBlockStream() throws InterruptedException { verify(subscribeStreamObserver1, times(1)).onNext(subscribeStreamResponse); verify(subscribeStreamObserver2, times(1)).onNext(subscribeStreamResponse); verify(subscribeStreamObserver3, times(1)).onNext(subscribeStreamResponse); - } @Test @@ -215,6 +210,5 @@ public void testFullHappyPath() throws IOException, InterruptedException { verify(subscribeStreamObserver1, times(1)).onNext(subscribeStreamResponse); verify(subscribeStreamObserver2, times(1)).onNext(subscribeStreamResponse); verify(subscribeStreamObserver3, times(1)).onNext(subscribeStreamResponse); - } } diff --git a/server/src/test/java/com/hedera/block/server/BlockStreamServiceTest.java b/server/src/test/java/com/hedera/block/server/BlockStreamServiceTest.java index 26d327e3c..87c8b4abc 100644 --- a/server/src/test/java/com/hedera/block/server/BlockStreamServiceTest.java +++ b/server/src/test/java/com/hedera/block/server/BlockStreamServiceTest.java @@ -1,30 +1,48 @@ +/* + * Copyright (C) 2024 Hedera Hashgraph, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.hedera.block.server; +import static com.hedera.block.protos.BlockStreamService.BlockItem; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.verify; + import com.google.protobuf.Descriptors; import com.hedera.block.server.data.ObjectEvent; import com.hedera.block.server.mediator.StreamMediator; import com.hedera.block.server.producer.ItemAckBuilder; +import java.io.IOException; +import java.security.NoSuchAlgorithmException; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; -import java.io.IOException; -import java.security.NoSuchAlgorithmException; - -import static com.hedera.block.protos.BlockStreamService.BlockItem; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.Mockito.never; -import static org.mockito.Mockito.verify; - @ExtendWith(MockitoExtension.class) public class BlockStreamServiceTest { - @Mock - private ItemAckBuilder itemAckBuilder; + @Mock private ItemAckBuilder itemAckBuilder; - @Mock private StreamMediator, com.hedera.block.protos.BlockStreamService.BlockItem> streamMediator; + @Mock + private StreamMediator< + ObjectEvent, + com.hedera.block.protos.BlockStreamService.BlockItem> + streamMediator; @Test public void testServiceName() throws IOException, NoSuchAlgorithmException {