@Test public void testAttachmentsReturnsSameRecordOnSuccessiveCalls() throws Exception { DeliveryImpl delivery = new DeliveryImpl(null, Mockito.mock(LinkImpl.class), null); Record attachments = delivery.attachments(); Record attachments2 = delivery.attachments(); assertSame("Expected to get the same attachments", attachments, attachments2); }
@Override public Record attachments() { if(_attachments == null) { _attachments = new RecordImpl(); } return _attachments; }
DeliveryImpl implements Delivery { @Override public Record attachments() { if(_attachments == null) { _attachments = new RecordImpl(); } return _attachments; } }
DeliveryImpl implements Delivery { @Override public Record attachments() { if(_attachments == null) { _attachments = new RecordImpl(); } return _attachments; } DeliveryImpl(final byte[] tag, final LinkImpl link, DeliveryImpl previous); }
DeliveryImpl implements Delivery { @Override public Record attachments() { if(_attachments == null) { _attachments = new RecordImpl(); } return _attachments; } DeliveryImpl(final byte[] tag, final LinkImpl link, DeliveryImpl previous); @Override byte[] getTag(); @Override LinkImpl getLink(); @Override DeliveryState getLocalState(); @Override DeliveryState getRemoteState(); @Override boolean remotelySettled(); @Override void setMessageFormat(int messageFormat); @Override int getMessageFormat(); @Override void disposition(final DeliveryState state); @Override void settle(); @Override DeliveryImpl next(); @Override void free(); @Override DeliveryImpl getWorkNext(); @Override boolean isSettled(); @Override int available(); @Override boolean isWritable(); @Override boolean isReadable(); @Override boolean isAborted(); @Override boolean isPartial(); @Override boolean isUpdated(); @Override void clear(); @Override boolean isBuffered(); @Override Object getContext(); @Override void setContext(Object context); @Override Record attachments(); @Override String toString(); @Override int pending(); @Override void setDefaultDeliveryState(DeliveryState state); @Override DeliveryState getDefaultDeliveryState(); }
DeliveryImpl implements Delivery { @Override public Record attachments() { if(_attachments == null) { _attachments = new RecordImpl(); } return _attachments; } DeliveryImpl(final byte[] tag, final LinkImpl link, DeliveryImpl previous); @Override byte[] getTag(); @Override LinkImpl getLink(); @Override DeliveryState getLocalState(); @Override DeliveryState getRemoteState(); @Override boolean remotelySettled(); @Override void setMessageFormat(int messageFormat); @Override int getMessageFormat(); @Override void disposition(final DeliveryState state); @Override void settle(); @Override DeliveryImpl next(); @Override void free(); @Override DeliveryImpl getWorkNext(); @Override boolean isSettled(); @Override int available(); @Override boolean isWritable(); @Override boolean isReadable(); @Override boolean isAborted(); @Override boolean isPartial(); @Override boolean isUpdated(); @Override void clear(); @Override boolean isBuffered(); @Override Object getContext(); @Override void setContext(Object context); @Override Record attachments(); @Override String toString(); @Override int pending(); @Override void setDefaultDeliveryState(DeliveryState state); @Override DeliveryState getDefaultDeliveryState(); static final int DEFAULT_MESSAGE_FORMAT; }