Search in sources :

Example 1 with CustomRecordSearch

use of com.netsuite.webservices.test.setup.customization.CustomRecordSearch in project components by Talend.

the class SearchQueryTest method testSearchMultiSelectField.

@Test
public void testSearchMultiSelectField() throws Exception {
    clientService.getMetaDataSource().setCustomMetaDataSource(new TestCustomMetaDataSource());
    SearchQuery s1 = clientService.newSearch();
    s1.target("custom_record_type_1");
    s1.condition(new SearchCondition("Owner", "List.anyOf", Arrays.asList("123456789")));
    SearchRecord sr1 = (SearchRecord) s1.toNativeQuery();
    assertNotNull(sr1);
    Assert.assertEquals(CustomRecordSearch.class, sr1.getClass());
    CustomRecordSearch search = (CustomRecordSearch) sr1;
    assertNotNull(search.getBasic());
    CustomRecordSearchBasic searchBasic = search.getBasic();
    assertNotNull(searchBasic.getOwner());
    SearchMultiSelectField sf1 = searchBasic.getOwner();
    assertNotNull(sf1.getSearchValue());
    Assert.assertEquals(1, sf1.getSearchValue().size());
    Assert.assertEquals("123456789", sf1.getSearchValue().get(0).getInternalId());
}
Also used : SearchQuery(org.talend.components.netsuite.client.search.SearchQuery) SearchRecord(com.netsuite.webservices.test.platform.core.SearchRecord) SearchCondition(org.talend.components.netsuite.client.search.SearchCondition) CustomRecordSearch(com.netsuite.webservices.test.setup.customization.CustomRecordSearch) CustomRecordSearchBasic(com.netsuite.webservices.test.platform.common.CustomRecordSearchBasic) SearchMultiSelectField(com.netsuite.webservices.test.platform.core.SearchMultiSelectField) Test(org.junit.Test)

Aggregations

CustomRecordSearchBasic (com.netsuite.webservices.test.platform.common.CustomRecordSearchBasic)1 SearchMultiSelectField (com.netsuite.webservices.test.platform.core.SearchMultiSelectField)1 SearchRecord (com.netsuite.webservices.test.platform.core.SearchRecord)1 CustomRecordSearch (com.netsuite.webservices.test.setup.customization.CustomRecordSearch)1 Test (org.junit.Test)1 SearchCondition (org.talend.components.netsuite.client.search.SearchCondition)1 SearchQuery (org.talend.components.netsuite.client.search.SearchQuery)1