2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.protocol.bgp.rib.impl;
10 import static org.mockito.Mockito.mock;
11 import io.netty.channel.Channel;
13 import org.opendaylight.protocol.bgp.parser.BGPSessionListener;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev130919.OpenBuilder;
15 import org.opendaylight.yangtools.yang.binding.Notification;
18 * Mock of the BGP speakers session.
20 public class SpeakerSessionMock extends BGPSessionImpl {
22 private final BGPSessionListener client;
24 SpeakerSessionMock(final BGPSessionListener listener, final BGPSessionListener client) {
25 super(listener, mock(Channel.class), new OpenBuilder().setHoldTimer(5).build(), 10);
30 public void sendMessage(final Notification msg) {
31 this.lastMessageSentAt = System.nanoTime();
32 this.client.onMessage(this, msg);