@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);
}