@Test
public void updateOwnProfilePicture() throws Exception {

    // This is not a valid body, but the server prevents that in the real world.
    PictureUpload upload = PictureUpload.pictureUploadJPEG("picture.jpeg", new byte[0]);
    testVoidSpec(resource.updateProfilePicture(upload));
    RecordedRequest request = server.takeRequest(500, TimeUnit.MILLISECONDS);
    Buffer body = request.getBody();
    assertThat(body.readUtf8()).isEqualTo("{\"photo\":{"
          + "\"content\":[],"
          + "\"file_name\":\"picture.jpeg\","
          + "\"mime_type\":\"image/jpeg\""
          + "}}");
    testVoidSpec(resource.updateProfilePicture(RequestBody.create(MediaType.parse("multipart/form-data"), "")));
}