@Test
  public void testRequestIsWellFormed() throws BoxRestException, AuthFatalFailureException {
    String id = "testid123";

    GetCommentRequest request = new GetCommentRequest(CONFIG, JSON_PARSER, id, null);
    testRequestIsWellFormed(
        request,
        TestUtils.getConfig().getApiUrlAuthority(),
        TestUtils.getConfig().getApiUrlPath().concat(GetCommentRequest.getUri(id)),
        HttpStatus.SC_OK,
        RestMethod.GET);
  }
예제 #2
0
  @Test
  public void testParcelRoundTrip() throws IOException, BoxRestException {
    String emailJson = FileUtils.readFileToString(new File("testdata/email.json"));
    BoxEmail email = (BoxEmail) TestUtils.getFromJSON(emailJson, BoxEmail.class);

    TestParcel parcel = new TestParcel();
    email.writeToParcel(parcel, 0);
    BoxEmail fromParcel = new BoxEmail(parcel);
    Assert.assertEquals("testaccess", fromParcel.getAccess());
    Assert.assertEquals("*****@*****.**", fromParcel.getEmail());
  }