@Test void testPersistDocumentCompressed() { final DocumentEntity documentEntity = DocumentEntity.builder() .compression(DocumentCompression.GZIP) .build(); final CompressionService compressionService = mock(CompressionService.class); when(compressionServiceProvider.getCompressionService(DocumentCompression.GZIP)) .thenReturn(compressionService); when(compressionService.compress(CONTENT)) .thenReturn(COMPRESSED_CONTENT); final VaultLocation vaultLocation = mock(VaultLocation.class); underTest.persistDocument(documentEntity, CONTENT, vaultLocation); verify(vaultLocation, never()).upload(CONTENT); verify(vaultLocation).upload(COMPRESSED_CONTENT); verify(compressionServiceProvider).getCompressionService(DocumentCompression.GZIP); verify(compressionService).compress(CONTENT); }
public void persistDocument(final DocumentEntity documentEntity, final byte[] documentContents) { final VaultLocation vaultLocation = vaultLocationFactory.getLocation(documentEntity); persistDocument(documentEntity, documentContents, vaultLocation); }
VaultDocumentStorage { public void persistDocument(final DocumentEntity documentEntity, final byte[] documentContents) { final VaultLocation vaultLocation = vaultLocationFactory.getLocation(documentEntity); persistDocument(documentEntity, documentContents, vaultLocation); } }
VaultDocumentStorage { public void persistDocument(final DocumentEntity documentEntity, final byte[] documentContents) { final VaultLocation vaultLocation = vaultLocationFactory.getLocation(documentEntity); persistDocument(documentEntity, documentContents, vaultLocation); }  }
VaultDocumentStorage { public void persistDocument(final DocumentEntity documentEntity, final byte[] documentContents) { final VaultLocation vaultLocation = vaultLocationFactory.getLocation(documentEntity); persistDocument(documentEntity, documentContents, vaultLocation); }  void persistDocument(final DocumentEntity documentEntity, final byte[] documentContents); void persistDocument(final DocumentEntity documentEntity, final byte[] documentContents,
            final VaultLocation vaultLocation); }
VaultDocumentStorage { public void persistDocument(final DocumentEntity documentEntity, final byte[] documentContents) { final VaultLocation vaultLocation = vaultLocationFactory.getLocation(documentEntity); persistDocument(documentEntity, documentContents, vaultLocation); }  void persistDocument(final DocumentEntity documentEntity, final byte[] documentContents); void persistDocument(final DocumentEntity documentEntity, final byte[] documentContents,
            final VaultLocation vaultLocation);  }