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);
}
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));
}
Aggregations