Search in sources :

Example 1 with SearchEnumMultiSelectCustomField

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));
}
Also used : SearchEnumMultiSelectCustomField(com.netsuite.webservices.test.platform.core.SearchEnumMultiSelectCustomField) SearchEnumMultiSelectField(com.netsuite.webservices.test.platform.core.SearchEnumMultiSelectField) Test(org.junit.Test)

Aggregations

SearchEnumMultiSelectCustomField (com.netsuite.webservices.test.platform.core.SearchEnumMultiSelectCustomField)1 SearchEnumMultiSelectField (com.netsuite.webservices.test.platform.core.SearchEnumMultiSelectField)1 Test (org.junit.Test)1