Search in sources :

Example 1 with MessageSlicer

use of org.opendaylight.controller.cluster.messaging.MessageSlicer in project controller by opendaylight.

the class ConnectingClientConnectionTest method setup.

@Before
public void setup() {
    MockitoAnnotations.initMocks(this);
    doNothing().when(mockCallback).accept(any(MockFailure.class));
    ticker = new FakeTicker();
    ticker.advance(ThreadLocalRandom.current().nextLong());
    doReturn(ticker).when(mockContext).ticker();
    final ClientActorConfig mockConfig = AccessClientUtil.newMockClientActorConfig();
    doReturn(mockConfig).when(mockContext).config();
    doReturn(mock(MessageSlicer.class)).when(mockContext).messageSlicer();
    mockActor = TestProbe.apply(actorSystem);
    mockBackendInfo = new BackendInfo(mockActor.ref(), 0, ABIVersion.current(), 5);
    mockRequest = new MockRequest(mockIdentifier, mockReplyTo);
    mockRequest2 = new MockRequest(mockIdentifier, mockReplyTo);
    mockResponse = mockRequest.toRequestFailure(mockCause);
    mockResponseEnvelope = new FailureEnvelope(mockResponse, 0, 0, 0);
    mockCookie = ThreadLocalRandom.current().nextLong();
    queue = new ConnectingClientConnection<>(mockContext, mockCookie);
}
Also used : FailureEnvelope(org.opendaylight.controller.cluster.access.concepts.FailureEnvelope) FakeTicker(com.google.common.testing.FakeTicker) MessageSlicer(org.opendaylight.controller.cluster.messaging.MessageSlicer) Before(org.junit.Before)

Aggregations

FakeTicker (com.google.common.testing.FakeTicker)1 Before (org.junit.Before)1 FailureEnvelope (org.opendaylight.controller.cluster.access.concepts.FailureEnvelope)1 MessageSlicer (org.opendaylight.controller.cluster.messaging.MessageSlicer)1