use of org.apache.qpid.proton.engine.Delivery in project azure-iot-sdk-java by Azure.
the class AmqpsMessageTest method acknowledgeSetsRejectedDispositionForReject.
// Tests_SRS_AMQPSMESSAGE_14_003: [If the ACK_TYPE is REJECT, the function shall set a Rejected disposition on the private Delivery object.]
@Test
public void acknowledgeSetsRejectedDispositionForReject(@Mocked final Rejected mockRejected) {
new NonStrictExpectations() {
{
new Rejected();
result = mockRejected;
}
};
AmqpsMessage message = new AmqpsMessage();
message.setDelivery(mockDelivery);
message.acknowledge(AmqpsMessage.ACK_TYPE.REJECT);
final Delivery expectedDelivery = mockDelivery;
new Verifications() {
{
expectedDelivery.disposition(mockRejected);
}
};
}
use of org.apache.qpid.proton.engine.Delivery in project azure-iot-sdk-java by Azure.
the class AmqpsMessageTest method acknowledgeSettlesDelivery.
// Tests_SRS_AMQPSMESSAGE_14_005: [The function shall settle the delivery after setting the proper disposition.]
@Test
public void acknowledgeSettlesDelivery() {
AmqpsMessage message = new AmqpsMessage();
message.setDelivery(mockDelivery);
message.acknowledge(AmqpsMessage.ACK_TYPE.COMPLETE);
message.acknowledge(AmqpsMessage.ACK_TYPE.ABANDON);
message.acknowledge(AmqpsMessage.ACK_TYPE.REJECT);
final Delivery expectedDelivery = mockDelivery;
new Verifications() {
{
expectedDelivery.settle();
times = 3;
}
};
}
use of org.apache.qpid.proton.engine.Delivery in project azure-iot-sdk-java by Azure.
the class AmqpsMessageTest method acknowledgeSetsReleasedDispositionForAbandon.
// Tests_SRS_AMQPSMESSAGE_14_002: [If the ACK_TYPE is ABANDON, the function shall set a Released disposition on the private Delivery object.]
@Test
public void acknowledgeSetsReleasedDispositionForAbandon() {
AmqpsMessage message = new AmqpsMessage();
message.setDelivery(mockDelivery);
message.acknowledge(AmqpsMessage.ACK_TYPE.ABANDON);
final Delivery expectedDelivery = mockDelivery;
new Verifications() {
{
expectedDelivery.disposition(Released.getInstance());
}
};
}
use of org.apache.qpid.proton.engine.Delivery in project azure-iot-sdk-java by Azure.
the class AmqpsMessageTest method acknowledgeSetsAcceptedDispositionForComlete.
// Tests_SRS_AMQPSMESSAGE_14_001: [If the ACK_TYPE is COMPLETE, the function shall set an Accepted disposition on the private Delivery object.]
@Test
public void acknowledgeSetsAcceptedDispositionForComlete() {
AmqpsMessage message = new AmqpsMessage();
message.setDelivery(mockDelivery);
message.acknowledge(AmqpsMessage.ACK_TYPE.COMPLETE);
final Delivery expectedDelivery = mockDelivery;
new Verifications() {
{
expectedDelivery.disposition(Accepted.getInstance());
}
};
}
Aggregations