@Test
  public void testImportItemAllSuccess() throws Exception {
    List<PhotoAlbum> albums =
        ImmutableList.of(new PhotoAlbum("id1", "albumb1", "This is a fake albumb"));

    List<PhotoModel> photos =
        ImmutableList.of(
            fakeJobstoreModel(
                jobStore,
                new PhotoModel(
                    "Pic1",
                    "http://fake.com/1.jpg",
                    "A pic",
                    "image/jpg",
                    "p1", // dataId
                    "id1", // albumId
                    true /*isInTempStore*/),
                new byte[CHUNK_SIZE]),
            fakeJobstoreModel(
                jobStore,
                new PhotoModel(
                    "Pic2",
                    "https://fake.com/2.png",
                    "fine art",
                    "image/png",
                    "p2", // dataId
                    "id1", // albumId
                    true /*isInTempStore*/),
                new byte[CHUNK_SIZE]));
    PhotosContainerResource data = new PhotosContainerResource(albums, photos);

    Call call = mock(Call.class);
    doReturn(call)
        .when(client)
        .newCall(
            argThat(
                (Request r) ->
                    r.url()
                        .toString()
                        .equals("https://www.baseurl.com/v1.0/me/drive/special/photos/children")));
    Response response = mock(Response.class);
    ResponseBody body = mock(ResponseBody.class);
    when(body.bytes())
        .thenReturn(
            ResponseBody.create(MediaType.parse("application/json"), "{\"id\": \"id1\"}").bytes());
    when(body.string())
        .thenReturn(
            ResponseBody.create(MediaType.parse("application/json"), "{\"id\": \"id1\"}").string());
    when(response.code()).thenReturn(200);
    when(response.body()).thenReturn(body);
    when(call.execute()).thenReturn(response);

    Call call2 = mock(Call.class);
    doReturn(call2)
        .when(client)
        .newCall(argThat((Request r) -> r.url().toString().contains("createUploadSession")));
    Response response2 = mock(Response.class);
    ResponseBody body2 = mock(ResponseBody.class);
    when(body2.bytes())
        .thenReturn(
            ResponseBody.create(
                    MediaType.parse("application/json"),
                    "{\"uploadUrl\": \"https://scalia.com/link\"}")
                .bytes());
    when(body2.string())
        .thenReturn(
            ResponseBody.create(
                    MediaType.parse("application/json"),
                    "{\"uploadUrl\": \"https://scalia.com/link\"}")
                .string());
    when(response2.code()).thenReturn(200);
    when(response2.body()).thenReturn(body2);
    when(call2.execute()).thenReturn(response2);

    Call call3 = mock(Call.class);
    doReturn(call3)
        .when(client)
        .newCall(argThat((Request r) -> r.url().toString().contains("scalia.com/link")));
    Response response3 = mock(Response.class);
    ResponseBody body3 = mock(ResponseBody.class);
    when(body3.bytes())
        .thenReturn(
            ResponseBody.create(MediaType.parse("application/json"), "{\"id\": \"rand1\"}")
                .bytes());
    when(body3.string())
        .thenReturn(
            ResponseBody.create(MediaType.parse("application/json"), "{\"id\": \"rand1\"}")
                .string());
    when(response3.code()).thenReturn(200);
    when(response3.body()).thenReturn(body3);
    when(call3.execute()).thenReturn(response3);

    ImportResult result = importer.importItem(uuid, executor, authData, data);
    verify(client, times(5)).newCall(any());
    assertThat(result).isEqualTo(ImportResult.OK);
  }
This tests the MicrosoftPhotosImporter. 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/photos/MicrosoftPhotosImporterTest.java