Search in sources :

Example 1 with EmailAlias

use of com.box.sdk.EmailAlias in project camel by apache.

the class BoxUsersManagerIntegrationTest method testDeleteUserEmailAlias.

@Ignore
@Test
public void testDeleteUserEmailAlias() throws Exception {
    EmailAlias emailAlias = null;
    try {
        emailAlias = testUser.addEmailAlias(CAMEL_TEST_USER_EMAIL_ALIAS);
    } catch (BoxAPIException e) {
        throw new RuntimeException(String.format("Box API returned the error code %d\n\n%s", e.getResponseCode(), e.getResponse()), e);
    }
    final Map<String, Object> headers = new HashMap<String, Object>();
    // parameter type is String
    headers.put("CamelBox.userId", testUser.getID());
    // parameter type is String
    headers.put("CamelBox.emailAliasId", emailAlias.getID());
    requestBodyAndHeaders("direct://DELETEUSEREMAILALIAS", null, headers);
    assertNotNull("deleteUserEmailAlias email aliases", testUser.getEmailAliases());
    assertEquals("deleteUserEmailAlias email aliases", 0, testUser.getEmailAliases().size());
}
Also used : EmailAlias(com.box.sdk.EmailAlias) HashMap(java.util.HashMap) BoxAPIException(com.box.sdk.BoxAPIException) Ignore(org.junit.Ignore) Test(org.junit.Test)

Aggregations

BoxAPIException (com.box.sdk.BoxAPIException)1 EmailAlias (com.box.sdk.EmailAlias)1 HashMap (java.util.HashMap)1 Ignore (org.junit.Ignore)1 Test (org.junit.Test)1