@Test
public void testAddMembershipRequest() {
String groupId = "testgroupid";
String userId = "testuserid";
String role = "testrole";
BoxGroupMembershipRequestObject obj = BoxGroupMembershipRequestObject.addMembershipRequestObject(groupId, userId, role);
Object groupObj = obj.getFromEntity(BoxGroupMembership.FIELD_GROUP);
Assert.assertTrue(groupObj instanceof MapJSONStringEntity);
MapJSONStringEntity groupEntity = (MapJSONStringEntity) groupObj;
Assert.assertEquals(groupId, groupEntity.get(BoxGroup.FIELD_ID));
Object userObj = obj.getFromEntity(BoxGroupMembership.FIELD_USER);
Assert.assertTrue(userObj instanceof MapJSONStringEntity);
MapJSONStringEntity userEntity = (MapJSONStringEntity) userObj;
Assert.assertEquals(userId, userEntity.get(BoxUser.FIELD_ID));
Assert.assertEquals(role, obj.getFromEntity(BoxGroupMembership.FIELD_ROLE));
}