Skip to content
Snippets Groups Projects
Commit 97d0a1ce authored by OZG-Cloud Team's avatar OZG-Cloud Team
Browse files

OZG-6748 KOP-2750 Use getContentStream

parent e6abf5d0
No related branches found
No related tags found
No related merge requests found
......@@ -159,7 +159,7 @@ public class VorgangRemoteService {
}
String uploadIncomingFile(IncomingFile incomingFile) {
var fileContentStream = incomingFile.getContentStreamForFinalRead();
var fileContentStream = incomingFile.getContentStream();
var resultFuture = GrpcFileUploadUtils.createSender(this::buildChunkRequest, fileContentStream,
this::buildCallStreamObserver)
......
......@@ -431,6 +431,55 @@ class VorgangRemoteServiceTest {
}
}
@DisplayName("update incoming file")
@Nested
class TestUpdateIncomingFile {
@Mock
private IncomingFile incomingFile;
@Mock
private InputStream inputStream;
@Mock
private GrpcUploadBinaryFileResponse response;
@Mock
private GrpcUploadBinaryFileRequest request;
@BeforeEach
void mock() {
doReturn(response).when(vorgangCreator).waitUntilFutureToComplete(any(), any());
when(incomingFile.getContentStream()).thenReturn(inputStream);
doReturn(request).when(vorgangCreator).buildMetaDataRequest(incomingFile);
}
@DisplayName("should call get content stream")
@Test
void shouldCallGetContentStream() {
vorgangCreator.uploadIncomingFile(incomingFile);
verify(incomingFile).getContentStream();
}
@DisplayName("should call build request with incoming file")
@Test
void shouldCallBuildRequestWithIncomingFile() {
vorgangCreator.uploadIncomingFile(incomingFile);
verify(vorgangCreator).buildMetaDataRequest(incomingFile);
}
@DisplayName("should call wait until future complete")
@Test
void shouldCallWaitUntilFutureComplete() {
vorgangCreator.uploadIncomingFile(incomingFile);
verify(vorgangCreator).waitUntilFutureToComplete(any(), eq(inputStream));
}
}
@Nested
class TestWaitUntilFutureToComplete {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment