Search in sources :

Example 1 with EntityCustomField

use of com.netsuite.webservices.test.setup.customization.EntityCustomField in project components by Talend.

the class BasicMetaDataTest method testGetCustomFieldRefType.

@Test
public void testGetCustomFieldRefType() {
    EntityCustomField entityCustomField1 = new EntityCustomField();
    entityCustomField1.setFieldType(CustomizationFieldType.FREE_FORM_TEXT);
    entityCustomField1.setAppliesToContact(true);
    entityCustomField1.setAppliesToVendor(true);
    CustomFieldRefType customFieldRefType = basicMetaData.getCustomFieldRefType(TestRecordTypeEnum.CONTACT.getType(), BasicRecordType.ENTITY_CUSTOM_FIELD, entityCustomField1);
    assertEquals(CustomFieldRefType.STRING, customFieldRefType);
    customFieldRefType = basicMetaData.getCustomFieldRefType(TestRecordTypeEnum.VENDOR.getType(), BasicRecordType.ENTITY_CUSTOM_FIELD, entityCustomField1);
    assertEquals(CustomFieldRefType.STRING, customFieldRefType);
    customFieldRefType = basicMetaData.getCustomFieldRefType(TestRecordTypeEnum.PARTNER.getType(), BasicRecordType.ENTITY_CUSTOM_FIELD, entityCustomField1);
    assertNull(customFieldRefType);
}
Also used : EntityCustomField(com.netsuite.webservices.test.setup.customization.EntityCustomField) CustomFieldRefType(org.talend.components.netsuite.client.model.customfield.CustomFieldRefType) Test(org.junit.Test)

Example 2 with EntityCustomField

use of com.netsuite.webservices.test.setup.customization.EntityCustomField in project components by Talend.

the class CustomFieldAdaptersTest method testAdapterForEntityCustomField.

@Test
public void testAdapterForEntityCustomField() {
    EntityCustomField customField = new EntityCustomField();
    customField.setFieldType(CustomizationFieldType.DATETIME);
    customField.setAppliesToPartner(true);
    customField.setAppliesToVendor(true);
    EntityCustomFieldAdapter adapter1 = new EntityCustomFieldAdapter();
    assertTrue(adapter1.appliesTo(RecordType.PARTNER.value(), customField));
    assertTrue(adapter1.appliesTo(RecordType.VENDOR.value(), customField));
    assertEquals(CustomFieldRefType.DATE, adapter1.apply(customField));
    assertFalse(adapter1.appliesTo(RecordType.CONTACT.value(), customField));
}
Also used : EntityCustomField(com.netsuite.webservices.test.setup.customization.EntityCustomField) Test(org.junit.Test)

Aggregations

EntityCustomField (com.netsuite.webservices.test.setup.customization.EntityCustomField)2 Test (org.junit.Test)2 CustomFieldRefType (org.talend.components.netsuite.client.model.customfield.CustomFieldRefType)1