@SuppressWarnings("deprecation")
public void testUnackedPurge() throws IOException {
Binding binding = setupExchangeBindings(false);
channel.basicPublish(binding.x, binding.k, null, payload);
GetResponse response = channel.basicGet(binding.q, false);
assertFalse(response.getEnvelope().isRedeliver());
assertNotNull("The response SHOULD NOT BE null", response);
// If we purge the queue the unacked message should still be there on
// recover.
channel.queuePurge(binding.q);
response = channel.basicGet(binding.q, true);
assertNull("The response SHOULD BE null", response);
channel.basicRecoverAsync(true);
response = channel.basicGet(binding.q, false);
assertTrue(response.getEnvelope().isRedeliver());
assertNotNull("The response SHOULD NOT BE null", response);
// If we recover then purge the message should go away
channel.basicRecoverAsync(true);
channel.queuePurge(binding.q);