Search in sources :

Example 36 with ClientConnection

use of io.pravega.client.connection.impl.ClientConnection in project pravega by pravega.

the class StreamManagerImplTest method testSealedStream.

@Test(timeout = 10000)
public void testSealedStream() throws ConnectionFailedException {
    final String streamName = "stream";
    final Stream stream = new StreamImpl(defaultScope, streamName);
    // Setup Mocks
    ClientConnection connection = mock(ClientConnection.class);
    PravegaNodeUri location = new PravegaNodeUri("localhost", 0);
    Mockito.doAnswer(new Answer<Void>() {

        @Override
        public Void answer(InvocationOnMock invocation) throws Throwable {
            WireCommands.CreateSegment request = (WireCommands.CreateSegment) invocation.getArgument(0);
            connectionFactory.getProcessor(location).process(new WireCommands.SegmentCreated(request.getRequestId(), request.getSegment()));
            return null;
        }
    }).when(connection).send(Mockito.any(WireCommands.CreateSegment.class));
    Mockito.doAnswer(new Answer<Void>() {

        @Override
        public Void answer(InvocationOnMock invocation) throws Throwable {
            WireCommands.GetStreamSegmentInfo request = (WireCommands.GetStreamSegmentInfo) invocation.getArgument(0);
            connectionFactory.getProcessor(location).process(new WireCommands.StreamSegmentInfo(request.getRequestId(), request.getSegmentName(), true, false, false, 0, 0, 0));
            return null;
        }
    }).when(connection).send(Mockito.any(WireCommands.GetStreamSegmentInfo.class));
    connectionFactory.provideConnection(location, connection);
    MockController mockController = spy(new MockController(location.getEndpoint(), location.getPort(), connectionFactory, true));
    doReturn(CompletableFuture.completedFuture(true)).when(mockController).sealStream(defaultScope, streamName);
    StreamSegments empty = new StreamSegments(new TreeMap<>());
    doReturn(CompletableFuture.completedFuture(empty)).when(mockController).getCurrentSegments(defaultScope, streamName);
    ConnectionPoolImpl pool = new ConnectionPoolImpl(ClientConfig.builder().maxConnectionsPerSegmentStore(1).build(), connectionFactory);
    // Create a StreamManager
    @Cleanup final StreamManager streamManager = new StreamManagerImpl(mockController, pool);
    // Create a scope and stream and seal it.
    streamManager.createScope(defaultScope);
    streamManager.createStream(defaultScope, streamName, StreamConfiguration.builder().scalingPolicy(ScalingPolicy.fixed(3)).build());
    streamManager.sealStream(defaultScope, streamName);
    // Fetch StreamInfo
    StreamInfo info = streamManager.getStreamInfo(defaultScope, streamName);
    // validate results.
    assertEquals(defaultScope, info.getScope());
    assertEquals(streamName, info.getStreamName());
    assertNotNull(info.getTailStreamCut());
    assertEquals(stream, info.getTailStreamCut().asImpl().getStream());
    assertEquals(0, info.getTailStreamCut().asImpl().getPositions().size());
    assertNotNull(info.getHeadStreamCut());
    assertEquals(stream, info.getHeadStreamCut().asImpl().getStream());
    assertEquals(3, info.getHeadStreamCut().asImpl().getPositions().size());
    assertTrue(info.isSealed());
}
Also used : ConnectionPoolImpl(io.pravega.client.connection.impl.ConnectionPoolImpl) Cleanup(lombok.Cleanup) PravegaNodeUri(io.pravega.shared.protocol.netty.PravegaNodeUri) StreamImpl(io.pravega.client.stream.impl.StreamImpl) InvocationOnMock(org.mockito.invocation.InvocationOnMock) StreamManager(io.pravega.client.admin.StreamManager) StreamInfo(io.pravega.client.admin.StreamInfo) MockController(io.pravega.client.stream.mock.MockController) Stream(io.pravega.client.stream.Stream) ClientConnection(io.pravega.client.connection.impl.ClientConnection) WireCommands(io.pravega.shared.protocol.netty.WireCommands) StreamSegments(io.pravega.client.stream.impl.StreamSegments) Test(org.junit.Test)

Example 37 with ClientConnection

use of io.pravega.client.connection.impl.ClientConnection in project pravega by pravega.

the class StreamManagerImplTest method testListStreamInScope.

@Test(timeout = 10000)
public void testListStreamInScope() throws ConnectionFailedException {
    // Setup Mocks
    ClientConnection connection = mock(ClientConnection.class);
    PravegaNodeUri location = new PravegaNodeUri("localhost", 0);
    Mockito.doAnswer(new Answer<Void>() {

        @Override
        public Void answer(InvocationOnMock invocation) throws Throwable {
            WireCommands.CreateSegment request = (WireCommands.CreateSegment) invocation.getArgument(0);
            connectionFactory.getProcessor(location).process(new WireCommands.SegmentCreated(request.getRequestId(), request.getSegment()));
            return null;
        }
    }).when(connection).send(Mockito.any(WireCommands.CreateSegment.class));
    Mockito.doAnswer(new Answer<Void>() {

        @Override
        public Void answer(InvocationOnMock invocation) throws Throwable {
            WireCommands.GetStreamSegmentInfo request = (WireCommands.GetStreamSegmentInfo) invocation.getArgument(0);
            connectionFactory.getProcessor(location).process(new WireCommands.StreamSegmentInfo(request.getRequestId(), request.getSegmentName(), true, false, false, 0, 0, 0));
            return null;
        }
    }).when(connection).send(Mockito.any(WireCommands.GetStreamSegmentInfo.class));
    connectionFactory.provideConnection(location, connection);
    MockController mockController = new MockController(location.getEndpoint(), location.getPort(), connectionFactory, true);
    ConnectionPoolImpl pool = new ConnectionPoolImpl(ClientConfig.builder().maxConnectionsPerSegmentStore(1).build(), connectionFactory);
    @Cleanup final StreamManager streamManager = new StreamManagerImpl(mockController, pool);
    String scope = "scope";
    String stream1 = "stream1";
    String stream2 = "stream2";
    String stream3 = "stream3";
    streamManager.createScope(scope);
    streamManager.createStream(scope, stream1, StreamConfiguration.builder().scalingPolicy(ScalingPolicy.fixed(3)).tag("t1").build());
    streamManager.createStream(scope, stream2, StreamConfiguration.builder().scalingPolicy(ScalingPolicy.fixed(3)).build());
    streamManager.createStream(scope, stream3, StreamConfiguration.builder().scalingPolicy(ScalingPolicy.fixed(3)).build());
    Iterator<Stream> m = streamManager.listStreams(scope);
    Set<Stream> streams = new HashSet<>();
    assertTrue(m.hasNext());
    streams.add(m.next());
    assertTrue(m.hasNext());
    streams.add(m.next());
    assertTrue(m.hasNext());
    streams.add(m.next());
    assertFalse(m.hasNext());
    assertEquals(3, streams.size());
    assertTrue(streams.stream().anyMatch(x -> x.getStreamName().equals(stream1)));
    assertTrue(streams.stream().anyMatch(x -> x.getStreamName().equals(stream2)));
    assertTrue(streams.stream().anyMatch(x -> x.getStreamName().equals(stream3)));
    assertEquals(Collections.singleton("t1"), streamManager.getStreamTags(scope, stream1));
    assertEquals(Collections.singletonList(Stream.of(scope, stream1)), newArrayList(streamManager.listStreams(scope, "t1")));
    streamManager.updateStream(scope, stream1, StreamConfiguration.builder().scalingPolicy(ScalingPolicy.fixed(3)).build());
    assertEquals(Collections.emptySet(), streamManager.getStreamTags(scope, stream1));
}
Also used : Arrays(java.util.Arrays) AssertExtensions(io.pravega.test.common.AssertExtensions) Cleanup(lombok.Cleanup) DeleteScopeFailedException(io.pravega.client.stream.DeleteScopeFailedException) StreamConfiguration(io.pravega.client.stream.StreamConfiguration) KeyValueTableConfiguration(io.pravega.client.tables.KeyValueTableConfiguration) ReaderGroupNotFoundException(io.pravega.client.stream.ReaderGroupNotFoundException) StreamSegments(io.pravega.client.stream.impl.StreamSegments) MockController(io.pravega.client.stream.mock.MockController) ClientConnection(io.pravega.client.connection.impl.ClientConnection) KeyValueTableInfo(io.pravega.client.admin.KeyValueTableInfo) Stream(io.pravega.client.stream.Stream) After(org.junit.After) Mockito.doAnswer(org.mockito.Mockito.doAnswer) PravegaNodeUri(io.pravega.shared.protocol.netty.PravegaNodeUri) URI(java.net.URI) Mockito.doReturn(org.mockito.Mockito.doReturn) ReaderGroupConfig(io.pravega.client.stream.ReaderGroupConfig) Set(java.util.Set) StreamInfo(io.pravega.client.admin.StreamInfo) Sets(com.google.common.collect.Sets) Lists.newArrayList(com.google.common.collect.Lists.newArrayList) Assert.assertFalse(org.junit.Assert.assertFalse) TestUtils(io.pravega.test.common.TestUtils) Controller(io.pravega.client.control.impl.Controller) Futures(io.pravega.common.concurrent.Futures) Mockito.mock(org.mockito.Mockito.mock) StreamImpl(io.pravega.client.stream.impl.StreamImpl) ConnectionFailedException(io.pravega.shared.protocol.netty.ConnectionFailedException) StreamManager(io.pravega.client.admin.StreamManager) Exceptions(io.pravega.common.Exceptions) CompletableFuture(java.util.concurrent.CompletableFuture) ConnectionPoolImpl(io.pravega.client.connection.impl.ConnectionPoolImpl) Mockito.spy(org.mockito.Mockito.spy) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) Answer(org.mockito.stubbing.Answer) KeyValueTableManager(io.pravega.client.admin.KeyValueTableManager) InvocationOnMock(org.mockito.invocation.InvocationOnMock) Lists(com.google.common.collect.Lists) ControllerFailureException(io.pravega.client.control.impl.ControllerFailureException) Before(org.junit.Before) NameUtils(io.pravega.shared.NameUtils) Iterator(java.util.Iterator) Assert.assertNotNull(org.junit.Assert.assertNotNull) MockConnectionFactoryImpl(io.pravega.client.stream.mock.MockConnectionFactoryImpl) Assert.assertTrue(org.junit.Assert.assertTrue) AsyncIterator(io.pravega.common.util.AsyncIterator) Test(org.junit.Test) WireCommands(io.pravega.shared.protocol.netty.WireCommands) Mockito(org.mockito.Mockito) TreeMap(java.util.TreeMap) InvalidStreamException(io.pravega.client.stream.InvalidStreamException) Assert(org.junit.Assert) Collections(java.util.Collections) Mockito.reset(org.mockito.Mockito.reset) ScalingPolicy(io.pravega.client.stream.ScalingPolicy) Assert.assertEquals(org.junit.Assert.assertEquals) ClientConfig(io.pravega.client.ClientConfig) ConnectionPoolImpl(io.pravega.client.connection.impl.ConnectionPoolImpl) Cleanup(lombok.Cleanup) PravegaNodeUri(io.pravega.shared.protocol.netty.PravegaNodeUri) InvocationOnMock(org.mockito.invocation.InvocationOnMock) StreamManager(io.pravega.client.admin.StreamManager) MockController(io.pravega.client.stream.mock.MockController) ClientConnection(io.pravega.client.connection.impl.ClientConnection) Stream(io.pravega.client.stream.Stream) WireCommands(io.pravega.shared.protocol.netty.WireCommands) HashSet(java.util.HashSet) Test(org.junit.Test)

Example 38 with ClientConnection

use of io.pravega.client.connection.impl.ClientConnection in project pravega by pravega.

the class BatchClientImplTest method getMockConnectionFactory.

private MockConnectionFactoryImpl getMockConnectionFactory(PravegaNodeUri location) throws ConnectionFailedException {
    MockConnectionFactoryImpl connectionFactory = new MockConnectionFactoryImpl();
    ClientConnection connection = mock(ClientConnection.class);
    Mockito.doAnswer(new Answer<Void>() {

        @Override
        public Void answer(InvocationOnMock invocation) throws Throwable {
            GetStreamSegmentInfo request = (GetStreamSegmentInfo) invocation.getArgument(0);
            connectionFactory.getProcessor(location).process(new StreamSegmentInfo(request.getRequestId(), request.getSegmentName(), true, false, false, 0, 0, 0));
            return null;
        }
    }).when(connection).send(Mockito.any(GetStreamSegmentInfo.class));
    connectionFactory.provideConnection(location, connection);
    return connectionFactory;
}
Also used : GetStreamSegmentInfo(io.pravega.shared.protocol.netty.WireCommands.GetStreamSegmentInfo) GetStreamSegmentInfo(io.pravega.shared.protocol.netty.WireCommands.GetStreamSegmentInfo) StreamSegmentInfo(io.pravega.shared.protocol.netty.WireCommands.StreamSegmentInfo) InvocationOnMock(org.mockito.invocation.InvocationOnMock) MockConnectionFactoryImpl(io.pravega.client.stream.mock.MockConnectionFactoryImpl) ClientConnection(io.pravega.client.connection.impl.ClientConnection)

Example 39 with ClientConnection

use of io.pravega.client.connection.impl.ClientConnection in project pravega by pravega.

the class LargeEventWriterTest method testBufferSplitting.

@Test(timeout = 5000)
public void testBufferSplitting() throws NoSuchSegmentException, AuthenticationException, SegmentSealedException, ConnectionFailedException {
    Segment segment = Segment.fromScopedName("foo/bar/1");
    MockConnectionFactoryImpl connectionFactory = new MockConnectionFactoryImpl();
    MockController controller = new MockController("localhost", 0, connectionFactory, false);
    ClientConnection connection = Mockito.mock(ClientConnection.class);
    PravegaNodeUri location = new PravegaNodeUri("localhost", 0);
    connectionFactory.provideConnection(location, connection);
    ArrayList<ByteBuf> written = new ArrayList<>();
    answerRequest(connectionFactory, connection, location, CreateTransientSegment.class, r -> new SegmentCreated(r.getRequestId(), "transient-segment"));
    answerRequest(connectionFactory, connection, location, SetupAppend.class, r -> new AppendSetup(r.getRequestId(), segment.getScopedName(), r.getWriterId(), WireCommands.NULL_ATTRIBUTE_VALUE));
    answerRequest(connectionFactory, connection, location, ConditionalBlockEnd.class, r -> {
        ByteBuf data = r.getData();
        written.add(data);
        return new DataAppended(r.getRequestId(), r.getWriterId(), r.getEventNumber(), r.getEventNumber() - 1, r.getExpectedOffset() + data.readableBytes());
    });
    answerRequest(connectionFactory, connection, location, MergeSegments.class, r -> {
        return new SegmentsMerged(r.getRequestId(), r.getSource(), r.getTarget(), -1);
    });
    LargeEventWriter writer = new LargeEventWriter(writerId, controller, connectionFactory);
    EmptyTokenProviderImpl tokenProvider = new EmptyTokenProviderImpl();
    ArrayList<ByteBuffer> buffers = new ArrayList<>();
    buffers.add(ByteBuffer.allocate(Serializer.MAX_EVENT_SIZE * 2 + 1));
    buffers.add(ByteBuffer.allocate(Serializer.MAX_EVENT_SIZE));
    buffers.add(ByteBuffer.allocate(5));
    writer.writeLargeEvent(segment, buffers, tokenProvider, EventWriterConfig.builder().enableLargeEvents(true).build());
    assertEquals(4, written.size());
    assertEquals(Serializer.MAX_EVENT_SIZE, written.get(0).readableBytes());
    assertEquals(Serializer.MAX_EVENT_SIZE, written.get(1).readableBytes());
    assertEquals(Serializer.MAX_EVENT_SIZE, written.get(2).readableBytes());
    assertEquals(6 + WireCommands.TYPE_PLUS_LENGTH_SIZE * 3, written.get(3).readableBytes());
}
Also used : ArrayList(java.util.ArrayList) ByteBuf(io.netty.buffer.ByteBuf) ByteBuffer(java.nio.ByteBuffer) Segment(io.pravega.client.segment.impl.Segment) NoSuchSegment(io.pravega.shared.protocol.netty.WireCommands.NoSuchSegment) CreateTransientSegment(io.pravega.shared.protocol.netty.WireCommands.CreateTransientSegment) AppendSetup(io.pravega.shared.protocol.netty.WireCommands.AppendSetup) SegmentCreated(io.pravega.shared.protocol.netty.WireCommands.SegmentCreated) EmptyTokenProviderImpl(io.pravega.client.security.auth.EmptyTokenProviderImpl) PravegaNodeUri(io.pravega.shared.protocol.netty.PravegaNodeUri) DataAppended(io.pravega.shared.protocol.netty.WireCommands.DataAppended) MockConnectionFactoryImpl(io.pravega.client.stream.mock.MockConnectionFactoryImpl) MockController(io.pravega.client.stream.mock.MockController) ClientConnection(io.pravega.client.connection.impl.ClientConnection) SegmentsMerged(io.pravega.shared.protocol.netty.WireCommands.SegmentsMerged) Test(org.junit.Test)

Example 40 with ClientConnection

use of io.pravega.client.connection.impl.ClientConnection in project pravega by pravega.

the class LargeEventWriterTest method testRetriedErrors.

@Test(timeout = 5000)
public void testRetriedErrors() throws ConnectionFailedException, NoSuchSegmentException, AuthenticationException, SegmentSealedException {
    Segment segment = Segment.fromScopedName("foo/bar/1");
    MockConnectionFactoryImpl connectionFactory = new MockConnectionFactoryImpl();
    MockController controller = new MockController("localhost", 0, connectionFactory, false);
    ClientConnection connection = Mockito.mock(ClientConnection.class);
    PravegaNodeUri location = new PravegaNodeUri("localhost", 0);
    connectionFactory.provideConnection(location, connection);
    EmptyTokenProviderImpl tokenProvider = new EmptyTokenProviderImpl();
    ArrayList<ByteBuffer> events = new ArrayList<>();
    events.add(ByteBuffer.allocate(1));
    AtomicBoolean failed = new AtomicBoolean(false);
    AtomicBoolean succeeded = new AtomicBoolean(false);
    answerRequest(connectionFactory, connection, location, SetupAppend.class, r -> new AppendSetup(r.getRequestId(), segment.getScopedName(), r.getWriterId(), WireCommands.NULL_ATTRIBUTE_VALUE));
    answerRequest(connectionFactory, connection, location, ConditionalBlockEnd.class, r -> {
        ByteBuf data = r.getData();
        return new DataAppended(r.getRequestId(), r.getWriterId(), r.getEventNumber(), r.getEventNumber() - 1, r.getExpectedOffset() + data.readableBytes());
    });
    answerRequest(connectionFactory, connection, location, MergeSegments.class, r -> {
        return new SegmentsMerged(r.getRequestId(), r.getSource(), r.getTarget(), -1);
    });
    Mockito.doAnswer(new Answer<Void>() {

        @Override
        public Void answer(InvocationOnMock invocation) throws Throwable {
            CreateTransientSegment argument = (CreateTransientSegment) invocation.getArgument(0);
            failed.set(true);
            connectionFactory.getProcessor(location).process(new AuthTokenCheckFailed(argument.getRequestId(), "stacktrace", ErrorCode.TOKEN_EXPIRED));
            return null;
        }
    }).doAnswer(new Answer<Void>() {

        @Override
        public Void answer(InvocationOnMock invocation) throws Throwable {
            CreateTransientSegment argument = (CreateTransientSegment) invocation.getArgument(0);
            succeeded.set(true);
            connectionFactory.getProcessor(location).process(new SegmentCreated(argument.getRequestId(), "transient-segment"));
            return null;
        }
    }).when(connection).send(any(CreateTransientSegment.class));
    LargeEventWriter writer = new LargeEventWriter(writerId, controller, connectionFactory);
    writer.writeLargeEvent(segment, events, tokenProvider, EventWriterConfig.builder().build());
    assertTrue(failed.getAndSet(false));
    assertTrue(succeeded.getAndSet(false));
    Mockito.doAnswer(new Answer<Void>() {

        @Override
        public Void answer(InvocationOnMock invocation) throws Throwable {
            CreateTransientSegment argument = (CreateTransientSegment) invocation.getArgument(0);
            failed.set(true);
            connectionFactory.getProcessor(location).process(new WrongHost(argument.getRequestId(), "foo/bar/1", null, "stacktrace"));
            return null;
        }
    }).doAnswer(new Answer<Void>() {

        @Override
        public Void answer(InvocationOnMock invocation) throws Throwable {
            CreateTransientSegment argument = (CreateTransientSegment) invocation.getArgument(0);
            succeeded.set(true);
            connectionFactory.getProcessor(location).process(new SegmentCreated(argument.getRequestId(), "transient-segment"));
            return null;
        }
    }).when(connection).send(any(CreateTransientSegment.class));
    writer = new LargeEventWriter(writerId, controller, connectionFactory);
    writer.writeLargeEvent(segment, events, tokenProvider, EventWriterConfig.builder().build());
    assertTrue(failed.getAndSet(false));
    assertTrue(succeeded.getAndSet(false));
    Mockito.doAnswer(new Answer<Void>() {

        @Override
        public Void answer(InvocationOnMock invocation) throws Throwable {
            CreateTransientSegment argument = (CreateTransientSegment) invocation.getArgument(0);
            failed.set(true);
            connectionFactory.getProcessor(location).processingFailure(new ConnectionFailedException());
            return null;
        }
    }).doAnswer(new Answer<Void>() {

        @Override
        public Void answer(InvocationOnMock invocation) throws Throwable {
            CreateTransientSegment argument = (CreateTransientSegment) invocation.getArgument(0);
            succeeded.set(true);
            connectionFactory.getProcessor(location).process(new SegmentCreated(argument.getRequestId(), "transient-segment"));
            return null;
        }
    }).when(connection).send(any(CreateTransientSegment.class));
    writer = new LargeEventWriter(writerId, controller, connectionFactory);
    writer.writeLargeEvent(segment, events, tokenProvider, EventWriterConfig.builder().build());
    assertTrue(failed.getAndSet(false));
    assertTrue(succeeded.getAndSet(false));
}
Also used : ArrayList(java.util.ArrayList) WrongHost(io.pravega.shared.protocol.netty.WireCommands.WrongHost) ByteBuf(io.netty.buffer.ByteBuf) Segment(io.pravega.client.segment.impl.Segment) NoSuchSegment(io.pravega.shared.protocol.netty.WireCommands.NoSuchSegment) CreateTransientSegment(io.pravega.shared.protocol.netty.WireCommands.CreateTransientSegment) AuthTokenCheckFailed(io.pravega.shared.protocol.netty.WireCommands.AuthTokenCheckFailed) PravegaNodeUri(io.pravega.shared.protocol.netty.PravegaNodeUri) MockConnectionFactoryImpl(io.pravega.client.stream.mock.MockConnectionFactoryImpl) ClientConnection(io.pravega.client.connection.impl.ClientConnection) CreateTransientSegment(io.pravega.shared.protocol.netty.WireCommands.CreateTransientSegment) ByteBuffer(java.nio.ByteBuffer) AppendSetup(io.pravega.shared.protocol.netty.WireCommands.AppendSetup) EmptyTokenProviderImpl(io.pravega.client.security.auth.EmptyTokenProviderImpl) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) Answer(org.mockito.stubbing.Answer) SegmentCreated(io.pravega.shared.protocol.netty.WireCommands.SegmentCreated) InvocationOnMock(org.mockito.invocation.InvocationOnMock) DataAppended(io.pravega.shared.protocol.netty.WireCommands.DataAppended) MockController(io.pravega.client.stream.mock.MockController) ConnectionFailedException(io.pravega.shared.protocol.netty.ConnectionFailedException) SegmentsMerged(io.pravega.shared.protocol.netty.WireCommands.SegmentsMerged) Test(org.junit.Test)

Aggregations

ClientConnection (io.pravega.client.connection.impl.ClientConnection)87 PravegaNodeUri (io.pravega.shared.protocol.netty.PravegaNodeUri)81 MockController (io.pravega.client.stream.mock.MockController)79 MockConnectionFactoryImpl (io.pravega.client.stream.mock.MockConnectionFactoryImpl)78 Test (org.junit.Test)77 Cleanup (lombok.Cleanup)51 InvocationOnMock (org.mockito.invocation.InvocationOnMock)43 WireCommands (io.pravega.shared.protocol.netty.WireCommands)40 SetupAppend (io.pravega.shared.protocol.netty.WireCommands.SetupAppend)35 AppendSetup (io.pravega.shared.protocol.netty.WireCommands.AppendSetup)34 UUID (java.util.UUID)34 ReplyProcessor (io.pravega.shared.protocol.netty.ReplyProcessor)33 ByteBuffer (java.nio.ByteBuffer)31 CompletableFuture (java.util.concurrent.CompletableFuture)30 InOrder (org.mockito.InOrder)27 Append (io.pravega.shared.protocol.netty.Append)23 ConnectionFailedException (io.pravega.shared.protocol.netty.ConnectionFailedException)23 Answer (org.mockito.stubbing.Answer)17 ScheduledExecutorService (java.util.concurrent.ScheduledExecutorService)16 ArrayList (java.util.ArrayList)14