public BlobOperationResponse stageBlockBlobList(final Exchange exchange) throws Exception {
        ObjectHelper.notNull(exchange, MISSING_EXCHANGE);

        final Object object = exchange.getIn().getMandatoryBody();

        List<BlobBlock> blobBlocks = null;
        if (object instanceof List) {
            // noinspection unchecked
            blobBlocks = (List<BlobBlock>) object;
        } else if (object instanceof BlobBlock) {
            blobBlocks = Collections.singletonList((BlobBlock) object);
        }
        if (blobBlocks == null || blobBlocks.isEmpty()) {
            throw new IllegalArgumentException("Illegal storageBlocks payload");
        }

        if (LOG.isTraceEnabled()) {
            LOG.trace("Putting a blob [{}] from blocks from exchange [{}]...", configurationProxy.getBlobName(exchange),
                    exchange);
        }

        final BlobCommonRequestOptions commonRequestOptions = getCommonRequestOptions(exchange);

        final List<Block> blockEntries = new LinkedList<>();

        blobBlocks.forEach(blobBlock -> {
            blockEntries.add(blobBlock.getBlockEntry());
            client.stageBlockBlob(blobBlock.getBlockEntry().getName(),
                    blobBlock.getBlockStream(),
                    blobBlock.getBlockEntry().getSizeLong(),
                    commonRequestOptions.getContentMD5(),
                    commonRequestOptions.leaseId(),
                    commonRequestOptions.getTimeout());
        });

        final boolean commitBlockListLater = configurationProxy.isCommitBlockListLater(exchange);

        if (!commitBlockListLater) {
            // let us commit now
            exchange.getIn().setBody(blockEntries);
            return commitBlobBlockList(exchange);
        }

        return BlobOperationResponse.createWithEmptyBody();
    }
@Test
    void testStageBlockBlobList() throws Exception {
        final HttpHeaders httpHeaders = new HttpHeaders().set("x-test-header", "123");
        when(client.stageBlockBlob(anyString(), any(), anyLong(), any(), any(), any())).thenReturn(httpHeaders);

        final Exchange exchange = new DefaultExchange(context);
        exchange.getIn().setBody("test");
        exchange.getIn().setHeader(BlobConstants.COMMIT_BLOCK_LIST_LATER, true);

        // test
        final BlobOperations operations = new BlobOperations(configuration, client);

        // in case of invalid payload
        assertThrows(IllegalArgumentException.class, () -> operations.stageBlockBlobList(exchange));

        // in case of correct payload
        exchange.getIn().setBody(BlobBlock.createBlobBlock("1", new ByteArrayInputStream("test".getBytes())));

        // test again
        final BlobOperationResponse response = operations.stageBlockBlobList(exchange);

        assertNotNull(response);
        assertTrue((boolean) response.getBody());
    }