@Override
    public InputStream fetch(String fetchKey, Metadata metadata, ParseContext parseContext) throws TikaException, IOException {
        int tries = 0;
        Exception ex;
        do {
            try {
                long start = System.currentTimeMillis();
                String[] fetchKeySplit = fetchKey.split(",");
                String siteDriveId = fetchKeySplit[0];
                String driveItemId = fetchKeySplit[1];
                InputStream is = graphClient.drives().byDriveId(siteDriveId).items()
                        .byDriveItemId(driveItemId).content().get();

                long elapsed = System.currentTimeMillis() - start;
                LOGGER.debug("Total to fetch {}", elapsed);
                return is;
            } catch (Exception e) {
                LOGGER.warn("Exception fetching on retry=" + tries, e);
                ex = e;
            }
            LOGGER.warn("Sleeping for {} seconds before retry", throttleSeconds[tries]);
            try {
                Thread.sleep(throttleSeconds[tries]);
            } catch (InterruptedException e) {
                Thread.currentThread().interrupt();
            }
        } while (++tries < throttleSeconds.length);
        throw new TikaException("Could not parse " + fetchKey, ex);
    }
@Test
    void fetch() throws Exception {
        try (AutoCloseable ignored = MockitoAnnotations.openMocks(this)) {
            Mockito.when(graphClient.drives()).thenReturn(drivesRequestBuilder);
            Mockito.when(drivesRequestBuilder.byDriveId(siteDriveId))
                    .thenReturn(driveItemRequestBuilder);
            Mockito.when(driveItemRequestBuilder.items()).thenReturn(itemsRequestBuilder);
            Mockito.when(itemsRequestBuilder.byDriveItemId(driveItemid))
                    .thenReturn(driveItemItemRequestBuilder);
            Mockito.when(driveItemItemRequestBuilder.content()).thenReturn(contentRequestBuilder);
            String content = "content";
            Mockito.when(contentRequestBuilder.get())
                    .thenReturn(new ByteArrayInputStream(content.getBytes(StandardCharsets.UTF_8)));
            InputStream resultingInputStream =
                    microsoftGraphFetcher.fetch(siteDriveId + "," + driveItemid, new Metadata(), new ParseContext());
            Assertions.assertEquals(content,
                    IOUtils.toString(resultingInputStream, StandardCharsets.UTF_8));
        }
    }