@Test(groups = "slow", description = "Test Account DAO: custom fields") public void testCustomFields() throws CustomFieldApiException { final UUID accountId = UUID.randomUUID(); final String fieldName = UUID.randomUUID().toString().substring(0, 4); final String fieldValue = UUID.randomUUID().toString(); customFieldDao.create(new CustomFieldModelDao(internalCallContext.getCreatedDate(), fieldName, fieldValue, accountId, ObjectType.ACCOUNT), internalCallContext); final List<CustomFieldModelDao> customFieldMap = customFieldDao.getCustomFieldsForObject(accountId, ObjectType.ACCOUNT, internalCallContext); Assert.assertEquals(customFieldMap.size(), 1); final CustomFieldModelDao customField = customFieldMap.get(0); Assert.assertEquals(customField.getFieldName(), fieldName); Assert.assertEquals(customField.getFieldValue(), fieldValue); }
@Test(groups = "slow") public void testCreateCustomField() throws CustomFieldApiException { final UUID id = UUID.randomUUID(); final ObjectType objectType = ObjectType.ACCOUNT; String fieldName = "TestField1"; String fieldValue = "Kitty Hawk"; eventsListener.pushExpectedEvent(NextEvent.CUSTOM_FIELD); customFieldDao.create(new CustomFieldModelDao(internalCallContext.getCreatedDate(), fieldName, fieldValue, id, objectType), internalCallContext); assertListenerStatus(); fieldName = "TestField2"; fieldValue = "Cape Canaveral"; eventsListener.pushExpectedEvent(NextEvent.CUSTOM_FIELD); customFieldDao.create(new CustomFieldModelDao(internalCallContext.getCreatedDate(), fieldName, fieldValue, id, objectType), internalCallContext); assertListenerStatus(); } }
@Test(groups = "slow") public void testCreateCustomField() throws CustomFieldApiException { final UUID id = UUID.randomUUID(); final ObjectType objectType = ObjectType.ACCOUNT; String fieldName = "TestField1"; String fieldValue = "Kitty Hawk"; eventsListener.pushExpectedEvent(NextEvent.CUSTOM_FIELD); customFieldDao.create(new CustomFieldModelDao(internalCallContext.getCreatedDate(), fieldName, fieldValue, id, objectType), internalCallContext); assertListenerStatus(); fieldName = "TestField2"; fieldValue = "Cape Canaveral"; eventsListener.pushExpectedEvent(NextEvent.CUSTOM_FIELD); customFieldDao.create(new CustomFieldModelDao(internalCallContext.getCreatedDate(), fieldName, fieldValue, id, objectType), internalCallContext); assertListenerStatus(); } }