{
ChecksumObserver listener = new ChecksumObserver( "SHA-1" );
Resource resource = new Resource( "resource" );
TransferEvent transferEvent =
new TransferEvent( wagon, resource, TransferEvent.TRANSFER_INITIATED, TransferEvent.REQUEST_GET );
listener.transferInitiated( transferEvent );
transferEvent = new TransferEvent( wagon, resource, TransferEvent.TRANSFER_STARTED, TransferEvent.REQUEST_GET );
listener.transferStarted( transferEvent );
transferEvent = new TransferEvent( wagon, resource, TransferEvent.TRANSFER_PROGRESS, TransferEvent.REQUEST_GET );
listener.transferProgress( transferEvent, "checksum\n".getBytes(), 9 );
transferEvent =
new TransferEvent( wagon, resource, TransferEvent.TRANSFER_COMPLETED, TransferEvent.REQUEST_GET );
listener.transferCompleted( transferEvent );
assertEquals( "2e5daf0201ddeb068a62d5e08da18657ab2c6be9", listener.getActualChecksum() );
}