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

    PhotosContainerResource data = new PhotosContainerResource(albums, null);

    Call call = mock(Call.class);
    doReturn(call)
        .when(client)
        .newCall(
            argThat(
                (Request r) -> {
                  String body = "";

                  try {
                    final Buffer buffer = new Buffer();
                    r.body().writeTo(buffer);
                    body = buffer.readUtf8();
                  } catch (IOException e) {
                    return false;
                  }

                  return r.url()
                          .toString()
                          .equals("https://www.baseurl.com/v1.0/me/drive/special/photos/children")
                      && body.contains("album1_");
                }));
    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);

    ImportResult result = importer.importItem(uuid, executor, authData, data);
    verify(client, times(1)).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