@Test
public void testApplyDeliveryAssuranceAtMostOnce() throws RMException {
setUpDestination();
long mn = 10;
SequenceAcknowledgement ack = control.createMock(SequenceAcknowledgement.class);
List<AcknowledgementRange> ranges = new ArrayList<AcknowledgementRange>();
AcknowledgementRange r = control.createMock(AcknowledgementRange.class);
EasyMock.expect(ack.getAcknowledgementRange()).andReturn(ranges);
DeliveryAssuranceType da = control.createMock(DeliveryAssuranceType.class);
EasyMock.expect(manager.getDeliveryAssurance()).andReturn(da);
EasyMock.expect(da.isSetAtMostOnce()).andReturn(true);
control.replay();
DestinationSequence ds = new DestinationSequence(id, ref, 0, ack, ProtocolVariation.RM10WSA200408);
ds.setDestination(destination);
ds.applyDeliveryAssurance(mn, null);
control.verify();
control.reset();
ranges.add(r);
EasyMock.expect(destination.getManager()).andReturn(manager);
EasyMock.expect(manager.getDeliveryAssurance()).andReturn(da);
EasyMock.expect(da.isSetAtMostOnce()).andReturn(true);
EasyMock.expect(ack.getAcknowledgementRange()).andReturn(ranges);
EasyMock.expect(r.getLower()).andReturn(new Long(5));
EasyMock.expect(r.getUpper()).andReturn(new Long(15));
control.replay();
try {
ds.applyDeliveryAssurance(mn, null);