Skip to content

Commit

Permalink
spotless
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Peterson <[email protected]>
  • Loading branch information
mattp-swirldslabs committed Jul 23, 2024
1 parent 606562d commit 7916f42
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -36,17 +33,16 @@
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;
import java.security.NoSuchAlgorithmException;
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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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);

}
}
Original file line number Diff line number Diff line change
@@ -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<ObjectEvent<com.hedera.block.protos.BlockStreamService.BlockItem>, com.hedera.block.protos.BlockStreamService.BlockItem> streamMediator;
@Mock
private StreamMediator<
ObjectEvent<com.hedera.block.protos.BlockStreamService.BlockItem>,
com.hedera.block.protos.BlockStreamService.BlockItem>
streamMediator;

@Test
public void testServiceName() throws IOException, NoSuchAlgorithmException {
Expand Down

0 comments on commit 7916f42

Please sign in to comment.