private static <M extends DownloadableFile> M fakeJobstoreModel(
      TemporaryPerJobDataStore jobStore, M model, byte[] contents) throws IOException {
    checkState(
        model.isInTempStore(),
        "nonsensical fake: trying to fake a tempstore entry with isInTempStore() set to false");
    when(jobStore.getStream(uuid, model.getFetchableUrl()))
        .thenAnswer(
            new Answer() {
              public Object answer(InvocationOnMock invocation) {
                return new InputStreamWrapper(new ByteArrayInputStream(contents));
              }
            });
    return model;
  }
This tests the MicrosoftMediaImporter. As of now, it only tests the number of requests called.
More tests are needed to test request bodies and parameters.
extensions/data-transfer/portability-data-transfer-microsoft/src/test/java/org/datatransferproject/transfer/microsoft/media/MicrosoftMediaImporterTest.java