@Test
void testNewContext() {

    final UUID id = UUID.randomUUID();
    final byte[] content = {0, 1, 2, 3};
    final DocumentArchivingContext documentArchivingContext = DocumentArchivingContext.builder()
            .id(id)
            .content(content)
            .contentLength(4)
            .source("unknown")
            .type(DocumentType.PDF)
            .versionNumber(123)
            .build();
    when(checksumProvider.checksum(content))
            .thenReturn(Mono.just("textchecksum"));
    when(compressionConfigurationProperties.getAlgorithm())
            .thenReturn(DocumentCompression.GZIP);
    final Mono<DocumentCreationContext> result = underTest.newContext(documentArchivingContext);
    StepVerifier.create(result)
            .consumeNextWith(documentCreationContext -> {
                assertThat(documentCreationContext.getId(), is(id));
                assertThat(documentCreationContext.getFileSize(), is(4L));
                assertThat(documentCreationContext.getSource(), is("unknown"));
                assertThat(documentCreationContext.getType(), is(DocumentType.PDF));
                assertThat(documentCreationContext.getChecksum(), is("textchecksum"));
                assertThat(documentCreationContext.getVersionNumber(), is(123));
                assertThat(documentCreationContext.getCompression(), is(DocumentCompression.GZIP));
                assertThat(documentCreationContext.getStatus(), is(DocumentStatus.DOWNLOADED));
            })
            .verifyComplete();
}