use of com.netsuite.webservices.test.platform.core.SearchEnumMultiSelectCustomField in project components by Talend.
the class SearchFieldAdaptersTest method testAdapterForEnumMultiSelectSearchField.
@Test
public void testAdapterForEnumMultiSelectSearchField() {
SearchEnumMultiSelectFieldAdapter adapter1 = new SearchEnumMultiSelectFieldAdapter(basicMetaData, SearchFieldType.SELECT, SearchEnumMultiSelectField.class);
SearchEnumMultiSelectField field1 = (SearchEnumMultiSelectField) adapter1.populate(null, "List.anyOf", Arrays.asList("abc"));
assertNotNull(field1);
assertEquals(SearchEnumMultiSelectFieldOperator.ANY_OF, field1.getOperator());
assertNotNull(field1.getSearchValue());
assertEquals(1, field1.getSearchValue().size());
assertEquals("abc", field1.getSearchValue().get(0));
field1 = (SearchEnumMultiSelectField) adapter1.populate(null, "List.noneOf", Collections.emptyList());
assertEquals(SearchEnumMultiSelectFieldOperator.NONE_OF, field1.getOperator());
assertNotNull(field1.getSearchValue());
assertEquals(0, field1.getSearchValue().size());
SearchEnumMultiSelectFieldAdapter adapter2 = new SearchEnumMultiSelectFieldAdapter(basicMetaData, SearchFieldType.CUSTOM_SELECT, SearchEnumMultiSelectCustomField.class);
SearchEnumMultiSelectCustomField field2 = (SearchEnumMultiSelectCustomField) adapter2.populate(null, "List.anyOf", Arrays.asList("qwerty"));
assertNotNull(field2);
assertEquals(SearchEnumMultiSelectFieldOperator.ANY_OF, field2.getOperator());
assertEquals(1, field2.getSearchValue().size());
assertEquals("qwerty", field2.getSearchValue().get(0));
}
Aggregations