@Test void testStore() { BlobMetadata blobMetadata = mock(BlobMetadata.class); ReadableByteChannel readableByteChannel = mock(ReadableByteChannel.class); when(blobStore.store(readableByteChannel)).thenReturn(blobMetadata); assertEquals(blobMetadata, transactionalBlobStoreDecorator.store(readableByteChannel)); }
@Override public BlobMetadata store(ReadableByteChannel fromChannel) { BlobMetadata blobMetadata = super.store(fromChannel); String transactionId = (String) getResource(TRANSACTION_ID_RESOURCE_NAME); transactionBlobMap.put(transactionId, blobMetadata.getId()); return blobMetadata; }
TransactionalBlobStoreDecorator extends BlobStoreDecorator implements TransactionListener { @Override public BlobMetadata store(ReadableByteChannel fromChannel) { BlobMetadata blobMetadata = super.store(fromChannel); String transactionId = (String) getResource(TRANSACTION_ID_RESOURCE_NAME); transactionBlobMap.put(transactionId, blobMetadata.getId()); return blobMetadata; } }
TransactionalBlobStoreDecorator extends BlobStoreDecorator implements TransactionListener { @Override public BlobMetadata store(ReadableByteChannel fromChannel) { BlobMetadata blobMetadata = super.store(fromChannel); String transactionId = (String) getResource(TRANSACTION_ID_RESOURCE_NAME); transactionBlobMap.put(transactionId, blobMetadata.getId()); return blobMetadata; } TransactionalBlobStoreDecorator(BlobStore delegateBlobStore); }
TransactionalBlobStoreDecorator extends BlobStoreDecorator implements TransactionListener { @Override public BlobMetadata store(ReadableByteChannel fromChannel) { BlobMetadata blobMetadata = super.store(fromChannel); String transactionId = (String) getResource(TRANSACTION_ID_RESOURCE_NAME); transactionBlobMap.put(transactionId, blobMetadata.getId()); return blobMetadata; } TransactionalBlobStoreDecorator(BlobStore delegateBlobStore); @Override BlobMetadata store(ReadableByteChannel fromChannel); @Override void delete(String blobId); @Override void rollbackTransaction(String transactionId); @Override void doCleanupAfterCompletion(String transactionId); }
TransactionalBlobStoreDecorator extends BlobStoreDecorator implements TransactionListener { @Override public BlobMetadata store(ReadableByteChannel fromChannel) { BlobMetadata blobMetadata = super.store(fromChannel); String transactionId = (String) getResource(TRANSACTION_ID_RESOURCE_NAME); transactionBlobMap.put(transactionId, blobMetadata.getId()); return blobMetadata; } TransactionalBlobStoreDecorator(BlobStore delegateBlobStore); @Override BlobMetadata store(ReadableByteChannel fromChannel); @Override void delete(String blobId); @Override void rollbackTransaction(String transactionId); @Override void doCleanupAfterCompletion(String transactionId);  }