use of com.netsuite.webservices.test.platform.core.SearchLongField in project components by Talend.
the class SearchFieldAdaptersTest method testAdapterForLongSearchField.
@Test
public void testAdapterForLongSearchField() {
SearchLongFieldAdapter adapter1 = new SearchLongFieldAdapter(basicMetaData, SearchFieldType.LONG, SearchLongField.class);
SearchLongField field1 = (SearchLongField) adapter1.populate(null, "Long.greaterThanOrEqualTo", Arrays.asList("12000"));
assertNotNull(field1);
assertEquals(SearchLongFieldOperator.GREATER_THAN_OR_EQUAL_TO, field1.getOperator());
assertEquals(Long.valueOf(12000), field1.getSearchValue());
field1 = (SearchLongField) adapter1.populate(null, "Long.between", Arrays.asList("10000", "30000"));
assertEquals(SearchLongFieldOperator.BETWEEN, field1.getOperator());
assertEquals(Long.valueOf(10000), field1.getSearchValue());
assertEquals(Long.valueOf(30000), field1.getSearchValue2());
field1 = (SearchLongField) adapter1.populate(null, "Long.lessThan", null);
assertEquals(SearchLongFieldOperator.LESS_THAN, field1.getOperator());
assertNull(field1.getSearchValue());
SearchLongFieldAdapter adapter2 = new SearchLongFieldAdapter(basicMetaData, SearchFieldType.CUSTOM_LONG, SearchLongCustomField.class);
SearchLongCustomField field2 = (SearchLongCustomField) adapter2.populate(null, "Long.notEqualTo", Arrays.asList("-1"));
assertNotNull(field2);
assertEquals(SearchLongFieldOperator.NOT_EQUAL_TO, field2.getOperator());
assertEquals(Long.valueOf(-1), field2.getSearchValue());
}
Aggregations