use of org.opendaylight.protocol.pcep.pcc.mock.protocol.PCCSessionListener in project bgpcep by opendaylight.
the class PCCSessionListenerTest method testSendError.
@Test
public void testSendError() {
final PCCSessionListener listener = new PCCSessionListener(1, this.tunnelManager, false);
listener.onSessionUp(this.mockedSession);
listener.sendError(MsgBuilderUtil.createErrorMsg(PCEPErrors.ATTEMPT_2ND_SESSION, 0));
verify(this.mockedSession).sendMessage(Mockito.any());
}
use of org.opendaylight.protocol.pcep.pcc.mock.protocol.PCCSessionListener in project bgpcep by opendaylight.
the class PCCSessionListenerTest method testSendReport.
@Test
public void testSendReport() {
final PCCSessionListener listener = new PCCSessionListener(1, this.tunnelManager, false);
listener.onSessionUp(this.mockedSession);
listener.sendReport(null);
verify(this.mockedSession).sendMessage(Mockito.any());
}
use of org.opendaylight.protocol.pcep.pcc.mock.protocol.PCCSessionListener in project bgpcep by opendaylight.
the class PCCSessionListenerTest method testOnMessage.
@Test
public void testOnMessage() {
final PCCSessionListener listener = new PCCSessionListener(1, this.tunnelManager, false);
listener.onMessage(this.mockedSession, createUpdMsg(true));
verify(this.tunnelManager).onMessagePcupd(Mockito.any(Updates.class), Mockito.any(PCCSession.class));
verify(this.tunnelManager, Mockito.never()).onMessagePcInitiate(Mockito.any(Requests.class), Mockito.any(PCCSession.class));
listener.onMessage(this.mockedSession, createUpdMsg(false));
verify(this.tunnelManager, Mockito.times(2)).onMessagePcupd(Mockito.any(Updates.class), Mockito.any(PCCSession.class));
verify(this.tunnelManager, Mockito.never()).onMessagePcInitiate(Mockito.any(Requests.class), Mockito.any(PCCSession.class));
listener.onMessage(this.mockedSession, createInitMsg(false, true));
verify(this.tunnelManager, Mockito.times(2)).onMessagePcupd(Mockito.any(Updates.class), Mockito.any(PCCSession.class));
verify(this.tunnelManager).onMessagePcInitiate(Mockito.any(Requests.class), Mockito.any(PCCSession.class));
listener.onMessage(this.mockedSession, createInitMsg(true, false));
verify(this.tunnelManager, Mockito.times(2)).onMessagePcupd(Mockito.any(Updates.class), Mockito.any(PCCSession.class));
verify(this.tunnelManager, Mockito.times(2)).onMessagePcInitiate(Mockito.any(Requests.class), Mockito.any(PCCSession.class));
listener.onMessage(this.mockedSession, createInitMsg(false, false));
verify(this.tunnelManager, Mockito.times(2)).onMessagePcupd(Mockito.any(Updates.class), Mockito.any(PCCSession.class));
verify(this.tunnelManager, Mockito.times(3)).onMessagePcInitiate(Mockito.any(Requests.class), Mockito.any(PCCSession.class));
}
Aggregations