public void customizeMock()

in src/it/java/com/epam/digital/data/platform/excerpt/worker/TemplateCephServiceMockHelper.java [34:45]


  public void customizeMock(CephService mockCephService, String bucket,
      String docxPath, String folderPath) {

    var filesWithPathInFolder = getFilesWithPathInFolder(docxPath);
    var filesWithFullPath = getFilesWithFullPath(filesWithPathInFolder, folderPath);
    for (var entry : filesWithFullPath.entrySet()) {
      var cephObject = mock(CephObject.class);
      when(cephObject.getContent()).thenReturn(new ByteArrayInputStream(entry.getValue()));
      when(mockCephService.get(bucket, entry.getKey())).thenReturn(Optional.of(cephObject));
    }
    when(mockCephService.getKeys(bucket, folderPath)).thenReturn(filesWithFullPath.keySet());
  }