Tabnine Logo
CustomField.getFieldName
Code IndexAdd Tabnine to your IDE (free)

How to use
getFieldName
method
in
org.killbill.billing.util.customfield.CustomField

Best Java code snippets using org.killbill.billing.util.customfield.CustomField.getFieldName (Showing top 14 results out of 315)

origin: killbill/killbill

@Test(groups = "slow")
public void testCustomFieldNoId() throws Exception {
  // Verify that when coming from a plugin, the id isn't required
  final CustomField customField = Mockito.mock(CustomField.class);
  Mockito.when(customField.getObjectId()).thenReturn(accountId);
  Mockito.when(customField.getObjectType()).thenReturn(ObjectType.ACCOUNT);
  Mockito.when(customField.getFieldName()).thenReturn(UUID.randomUUID().toString());
  Mockito.when(customField.getFieldValue()).thenReturn(UUID.randomUUID().toString());
  eventsListener.pushExpectedEvents(NextEvent.CUSTOM_FIELD);
  customFieldUserApi.addCustomFields(ImmutableList.<CustomField>of(customField), callContext);
  assertListenerStatus();
}
origin: killbill/killbill

  @Override
  public CustomFieldModelDao apply(final CustomField input) {
    // Respect user-specified ID
    // TODO See https://github.com/killbill/killbill/issues/35
    if (input.getId() != null) {
      return new CustomFieldModelDao(input.getId(), context.getCreatedDate(), context.getCreatedDate(), input.getFieldName(), input.getFieldValue(), input.getObjectId(), input.getObjectType());
    } else {
      return new CustomFieldModelDao(context.getCreatedDate(), input.getFieldName(), input.getFieldValue(), input.getObjectId(), input.getObjectType());
    }
  }
});
origin: killbill/killbill

  @Override
  public CustomFieldModelDao apply(final CustomField input) {
    return new CustomFieldModelDao(input.getId(), internalCallContext.getCreatedDate(), internalCallContext.getUpdatedDate(), input.getFieldName(), input.getFieldValue(), input.getObjectId(), input.getObjectType());
  }
});
origin: killbill/killbill

@Test(groups = "slow")
public void testCustomFieldUpdate() throws Exception {
  final CustomField customField1 = new StringCustomField("gtqre", "value1", ObjectType.ACCOUNT, accountId, callContext.getCreatedDate());
  eventsListener.pushExpectedEvents(NextEvent.CUSTOM_FIELD);
  customFieldUserApi.addCustomFields(ImmutableList.<CustomField>of(customField1), callContext);
  assertListenerStatus();
  final CustomField update1 = new StringCustomField(customField1.getId(), customField1.getFieldName(), "value2", customField1.getObjectType(), customField1.getObjectId(), callContext.getCreatedDate());
  customFieldUserApi.updateCustomFields(ImmutableList.of(update1), callContext);
  List<CustomField> all = customFieldUserApi.getCustomFieldsForAccount(accountId, callContext);
  Assert.assertEquals(all.size(), 1);
  Assert.assertEquals(all.get(0).getId(), update1.getId());
  Assert.assertEquals(all.get(0).getObjectType(), update1.getObjectType());
  Assert.assertEquals(all.get(0).getObjectId(), update1.getObjectId());
  Assert.assertEquals(all.get(0).getFieldName(), update1.getFieldName());
  Assert.assertEquals(all.get(0).getFieldValue(), "value2");
  try {
    customFieldUserApi.updateCustomFields(ImmutableList.<CustomField>of(new StringCustomField("gtqre", "value1", ObjectType.ACCOUNT, accountId, callContext.getCreatedDate())), callContext);
    Assert.fail("Updating custom field should fail");
  } catch (final CustomFieldApiException e) {
    Assert.assertEquals(e.getCode(), ErrorCode.CUSTOM_FIELD_DOES_NOT_EXISTS_FOR_ID.getCode());
  }
  try {
    customFieldUserApi.updateCustomFields(ImmutableList.<CustomField>of(new StringCustomField(customField1.getId(), "wrongName", "value2", customField1.getObjectType(), customField1.getObjectId(), callContext.getCreatedDate())), callContext);
    Assert.fail("Updating custom field should fail");
  } catch (final CustomFieldApiException e) {
    Assert.assertEquals(e.getCode(), ErrorCode.CUSTOM_FIELD_INVALID_UPDATE.getCode());
  }
}
origin: killbill/killbill

Assert.assertEquals(all.get(0).getObjectId(), accountId);
Assert.assertEquals(all.get(0).getObjectType(), ObjectType.ACCOUNT);
Assert.assertEquals(all.get(0).getFieldName(), customField2.getFieldName());
Assert.assertEquals(all.get(0).getFieldValue(), customField2.getFieldValue());
origin: killbill/killbill

Assert.assertEquals(customFields.get(0).getFieldName(), customField.getFieldName());
Assert.assertEquals(customFields.get(0).getFieldValue(), customField.getFieldValue());
Assert.assertEquals(customFields.get(0).getObjectId(), customField.getObjectId());
origin: org.kill-bill.billing/killbill-jaxrs

public CustomFieldJson(final CustomField input, @Nullable final List<AuditLog> auditLogs) {
  this(input.getId(), input.getObjectId(), input.getObjectType(), input.getFieldName(), input.getFieldValue(), toAuditLogJson(auditLogs));
}
origin: org.kill-bill.billing/killbill-util

@Test(groups = "slow")
public void testCustomFieldNoId() throws Exception {
  // Verify that when coming from a plugin, the id isn't required
  final CustomField customField = Mockito.mock(CustomField.class);
  Mockito.when(customField.getObjectId()).thenReturn(accountId);
  Mockito.when(customField.getObjectType()).thenReturn(ObjectType.ACCOUNT);
  Mockito.when(customField.getFieldName()).thenReturn(UUID.randomUUID().toString());
  Mockito.when(customField.getFieldValue()).thenReturn(UUID.randomUUID().toString());
  eventsListener.pushExpectedEvents(NextEvent.CUSTOM_FIELD);
  customFieldUserApi.addCustomFields(ImmutableList.<CustomField>of(customField), callContext);
  assertListenerStatus();
}
origin: stackoverflow.com

 import org.apache.lucene.document.Document;
import org.apache.lucene.facet.sortedset.SortedSetDocValuesFacetField;
import org.hibernate.search.bridge.FieldBridge;
import org.hibernate.search.bridge.LuceneOptions;

import java.io.IOException;

public class CustomFieldBridge implements FieldBridge {

  public void set(String name, Object value, Document document, LuceneOptions luceneOptions) {
    if (value != null) {
      CustomField customField = (CustomField) value;
      if (customField.getFieldValue() != null) {
        String fieldName = customField.getFieldName();
        String fieldValue = customField.getFieldValue();
        CustomFacetsConfig config = new CustomFacetsConfig();
        config.setIndexFieldName(fieldName, fieldName);
        Document doc = new Document();
        doc.add(new SortedSetDocValuesFacetField(fieldName, fieldValue));
        try {
          config.CustomBuild(doc, document);
        } catch (IOException e) {
          e.printStackTrace();
        }
      }
    }
  }
}
origin: org.kill-bill.billing/killbill-util

  @Override
  public CustomFieldModelDao apply(final CustomField input) {
    // Respect user-specified ID
    // TODO See https://github.com/killbill/killbill/issues/35
    if (input.getId() != null) {
      return new CustomFieldModelDao(input.getId(), context.getCreatedDate(), context.getCreatedDate(), input.getFieldName(), input.getFieldValue(), input.getObjectId(), input.getObjectType());
    } else {
      return new CustomFieldModelDao(context.getCreatedDate(), input.getFieldName(), input.getFieldValue(), input.getObjectId(), input.getObjectType());
    }
  }
});
origin: org.kill-bill.billing/killbill-util

  @Override
  public CustomFieldModelDao apply(final CustomField input) {
    return new CustomFieldModelDao(input.getId(), internalCallContext.getCreatedDate(), internalCallContext.getUpdatedDate(), input.getFieldName(), input.getFieldValue(), input.getObjectId(), input.getObjectType());
  }
});
origin: org.kill-bill.billing/killbill-util

Assert.assertEquals(all.get(0).getObjectId(), accountId);
Assert.assertEquals(all.get(0).getObjectType(), ObjectType.ACCOUNT);
Assert.assertEquals(all.get(0).getFieldName(), customField2.getFieldName());
Assert.assertEquals(all.get(0).getFieldValue(), customField2.getFieldValue());
origin: org.kill-bill.billing/killbill-util

@Test(groups = "slow")
public void testCustomFieldUpdate() throws Exception {
  final CustomField customField1 = new StringCustomField("gtqre", "value1", ObjectType.ACCOUNT, accountId, callContext.getCreatedDate());
  eventsListener.pushExpectedEvents(NextEvent.CUSTOM_FIELD);
  customFieldUserApi.addCustomFields(ImmutableList.<CustomField>of(customField1), callContext);
  assertListenerStatus();
  final CustomField update1 = new StringCustomField(customField1.getId(), customField1.getFieldName(), "value2", customField1.getObjectType(), customField1.getObjectId(), callContext.getCreatedDate());
  customFieldUserApi.updateCustomFields(ImmutableList.of(update1), callContext);
  List<CustomField> all = customFieldUserApi.getCustomFieldsForAccount(accountId, callContext);
  Assert.assertEquals(all.size(), 1);
  Assert.assertEquals(all.get(0).getId(), update1.getId());
  Assert.assertEquals(all.get(0).getObjectType(), update1.getObjectType());
  Assert.assertEquals(all.get(0).getObjectId(), update1.getObjectId());
  Assert.assertEquals(all.get(0).getFieldName(), update1.getFieldName());
  Assert.assertEquals(all.get(0).getFieldValue(), "value2");
  try {
    customFieldUserApi.updateCustomFields(ImmutableList.<CustomField>of(new StringCustomField("gtqre", "value1", ObjectType.ACCOUNT, accountId, callContext.getCreatedDate())), callContext);
    Assert.fail("Updating custom field should fail");
  } catch (final CustomFieldApiException e) {
    Assert.assertEquals(e.getCode(), ErrorCode.CUSTOM_FIELD_DOES_NOT_EXISTS_FOR_ID.getCode());
  }
  try {
    customFieldUserApi.updateCustomFields(ImmutableList.<CustomField>of(new StringCustomField(customField1.getId(), "wrongName", "value2", customField1.getObjectType(), customField1.getObjectId(), callContext.getCreatedDate())), callContext);
    Assert.fail("Updating custom field should fail");
  } catch (final CustomFieldApiException e) {
    Assert.assertEquals(e.getCode(), ErrorCode.CUSTOM_FIELD_INVALID_UPDATE.getCode());
  }
}
origin: org.kill-bill.billing/killbill-util

Assert.assertEquals(customFields.get(0).getFieldName(), customField.getFieldName());
Assert.assertEquals(customFields.get(0).getFieldValue(), customField.getFieldValue());
Assert.assertEquals(customFields.get(0).getObjectId(), customField.getObjectId());
org.killbill.billing.util.customfieldCustomFieldgetFieldName

Popular methods of CustomField

  • getFieldValue
  • getId
  • getObjectId
  • getObjectType
  • updateValue

Popular in Java

  • Making http post requests using okhttp
  • compareTo (BigDecimal)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • startActivity (Activity)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • String (java.lang)
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • Collectors (java.util.stream)
  • JList (javax.swing)
  • Runner (org.openjdk.jmh.runner)
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now