Exemplo n.º 1
0
  @Test(groups = "slow")
  public void testCustomFields() throws EntityPersistenceException {
    final String fieldName = "testField1";
    final String fieldValue = "testField1_value";

    final UUID accountId = UUID.randomUUID();
    final List<CustomField> customFields = new ArrayList<CustomField>();
    customFields.add(new StringCustomField(fieldName, fieldValue));
    final CustomFieldDao customFieldDao = new AuditedCustomFieldDao(dbi);
    customFieldDao.saveEntities(accountId, ObjectType.ACCOUNT, customFields, internalCallContext);

    final Map<String, CustomField> customFieldMap =
        customFieldDao.loadEntities(accountId, ObjectType.ACCOUNT, internalCallContext);
    assertEquals(customFieldMap.size(), 1);
    final CustomField customField = customFieldMap.get(fieldName);
    assertEquals(customField.getName(), fieldName);
    assertEquals(customField.getValue(), fieldValue);
  }
 public BusinessBundleFieldModelDao(
     final Account account,
     final Long accountRecordId,
     final CustomField customField,
     final Long customFieldRecordId,
     @Nullable final AuditLog creationAuditLog,
     final Long tenantRecordId,
     @Nullable final ReportGroup reportGroup) {
   super(
       account,
       accountRecordId,
       customField,
       customFieldRecordId,
       creationAuditLog,
       tenantRecordId,
       reportGroup);
   this.bundleId = customField.getObjectId();
 }
Exemplo n.º 3
0
 public CustomFieldJson(final CustomField input, @Nullable final List<AuditLog> auditLogs) {
   this(input.getFieldName(), input.getFieldValue(), toAuditLogJson(auditLogs));
 }