StageLocationFactory { public Mono<StageLocation> getLocation(final String documentId, final DocumentType documentType) { return Mono.fromSupplier(() -> Path.of(stageConfigurationProperties.getLocation(), buildFileName(documentId, documentType))) .map(path -> StageLocation.builder() .path(path) .build() ); }  Mono<StageLocation> getLocation(final String documentId, final DocumentType documentType);  }
@Test void testGetLocation() { when(stageConfigurationProperties.getLocation()) .thenReturn("testlocation"); final StageLocation result = underTest.getLocation(TEST_DOCUMENT_ID, DocumentType.PDF) .block(); assertThat(result.getPath().toString(), is(TEST_LOCATION + FileSystems.getDefault().getSeparator() + TEST_DOCUMENT_ID + ".pdf")); }