throws InterruptedException, IOException, TimeoutException {
testSubject.setTransactional(false);
testSubject.setWaitForPublisherAck(true);
testSubject.setPublisherAckTimeout(123);
Connection connection = mock(Connection.class);
when(connectionFactory.createConnection()).thenReturn(connection);
Channel channel = mock(Channel.class);
when(channel.waitForConfirms()).thenReturn(true);
when(connection.createChannel(false)).thenReturn(channel);
GenericEventMessage<String> message = new GenericEventMessage<String>("Message");
when(serializer.serialize(message.getPayload(), byte[].class))
.thenReturn(new SimpleSerializedObject<byte[]>("Message".getBytes(UTF_8), byte[].class, "String", "0"));
when(serializer.serialize(message.getMetaData(), byte[].class))
.thenReturn(new SerializedMetaData<byte[]>(new byte[0], byte[].class));