use of com.netsuite.webservices.test.setup.customization.CustomRecordType in project components by Talend.
the class CustomMetaDataSourceTest method testGetCustomRecordTypes.
@Test
public void testGetCustomRecordTypes() throws Exception {
Map<String, CustomFieldSpec<RecordType, CustomizationFieldType>> customRecordFieldSpecs = createCustomRecordFieldSpecs();
CustomRecordType customRecordType = createCustomRecordType(customRecordFieldSpecs);
customMetaDataRetriever.setCustomRecordType(customRecordType);
customMetaDataRetriever.setCustomRecordFieldSpecs(customRecordFieldSpecs);
Collection<CustomRecordTypeInfo> recordTypeInfos = customMetaDataSource.getCustomRecordTypes();
assertNotNull(recordTypeInfos);
assertEquals(1, recordTypeInfos.size());
CustomRecordTypeInfo recordTypeInfo1 = recordTypeInfos.iterator().next();
assertNotNull(recordTypeInfo1.getName());
assertNotNull(recordTypeInfo1.getCustomizationRef());
assertEquals(customRecordType.getScriptId(), recordTypeInfo1.getName());
assertEquals(customRecordType.getScriptId(), recordTypeInfo1.getCustomizationRef().getScriptId());
assertEquals(customRecordType.getInternalId(), recordTypeInfo1.getCustomizationRef().getInternalId());
}
use of com.netsuite.webservices.test.setup.customization.CustomRecordType in project components by Talend.
the class CustomMetaDataSourceTest method createCustomRecordType.
protected CustomRecordType createCustomRecordType(Map<String, CustomFieldSpec<RecordType, CustomizationFieldType>> customFieldSpecs) throws Exception {
CustomRecordType customRecordType = new CustomRecordType();
customRecordType.setScriptId("custrecord1");
customRecordType.setInternalId("201");
Map<String, CustomFieldType> customFieldTypeMap = createCustomFieldTypes(customFieldSpecs);
customRecordType.setCustomFieldList(new CustomRecordTypeFieldList());
for (CustomFieldType customFieldType : customFieldTypeMap.values()) {
customRecordType.getCustomFieldList().getCustomField().add((CustomRecordCustomField) customFieldType);
}
return customRecordType;
}
use of com.netsuite.webservices.test.setup.customization.CustomRecordType in project components by Talend.
the class CustomMetaDataSourceTest method testGetCustomRecordType.
@Test
public void testGetCustomRecordType() throws Exception {
Map<String, CustomFieldSpec<RecordType, CustomizationFieldType>> customRecordFieldSpecs = createCustomRecordFieldSpecs();
CustomRecordType customRecordType = createCustomRecordType(customRecordFieldSpecs);
customMetaDataRetriever.setCustomRecordType(customRecordType);
customMetaDataRetriever.setCustomRecordFieldSpecs(customRecordFieldSpecs);
CustomRecordTypeInfo recordTypeInfo = customMetaDataSource.getCustomRecordType(customRecordType.getScriptId());
assertNotNull(recordTypeInfo);
Map<String, CustomFieldDesc> customFieldDescMap = customMetaDataSource.getCustomFields(recordTypeInfo);
assertNotNull(customFieldDescMap);
for (CustomFieldSpec customFieldSpec : customRecordFieldSpecs.values()) {
CustomFieldDesc customFieldDesc = customFieldDescMap.get(customFieldSpec.getScriptId());
assertNotNull(customFieldDesc);
assertNotNull(customFieldDesc.getCustomizationRef());
assertEquals(customFieldSpec.getScriptId(), customFieldDesc.getName());
assertEquals(customFieldSpec.getInternalId(), customFieldDesc.getCustomizationRef().getInternalId());
}
}
Aggregations