Package net.jodah.lyra.internal

Source Code of net.jodah.lyra.internal.ChannelHandlerTest

package net.jodah.lyra.internal;

import org.testng.annotations.Test;

import com.rabbitmq.client.AlreadyClosedException;
import com.rabbitmq.client.Channel;
import static org.mockito.Mockito.*;
@Test
public class ChannelHandlerTest extends AbstractFunctionalTest {
  @Test(expectedExceptions = AlreadyClosedException.class)
  public void shouldThrowOnAlreadyClosedChannelInvocation() throws Throwable {
    mockConnection();
    Channel channel = mockChannel().proxy;
    when(channel.getCloseReason()).thenReturn(channelShutdownSignal());
    channel.close();
    channel.abort();
  }

  public void shouldHandleCancelWithNullArgs() throws Throwable {
    mockConnection();
    mockChannel().proxy.basicCancel(null);
  }

  public void shouldHandleAddListenerWithNullArgs() throws Throwable {
    mockConnection();
    mockChannel().proxy.addConfirmListener(null);
  }
}
TOP

Related Classes of net.jodah.lyra.internal.ChannelHandlerTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.