Search in sources :

Example 6 with Account

use of com.netsuite.webservices.v2014_2.lists.accounting.Account in project components by Talend.

the class NetSuiteClientServiceIT method testConnectAndLogin.

@Test
public void testConnectAndLogin() throws Exception {
    NetSuiteClientService<?> connection = webServiceTestFixture.getClientService();
    connection.login();
    SearchResultSet<Record> rs = connection.newSearch().target("Account").condition(new SearchCondition("Type", "List.anyOf", Arrays.asList("Bank"))).search();
    int count = 10;
    int retrievedCount = 0;
    while (rs.next() && count-- > 0) {
        Record record = rs.get();
        assertEquals(AccountType.BANK, getProperty(record, "acctType"));
        retrievedCount++;
    }
    assertTrue(retrievedCount > 1);
}
Also used : SearchCondition(org.talend.components.netsuite.client.search.SearchCondition) Record(com.netsuite.webservices.v2014_2.platform.core.Record) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)4 Account (com.netsuite.webservices.v2016_2.lists.accounting.Account)3 ArrayList (java.util.ArrayList)3 Schema (org.apache.avro.Schema)3 IndexedRecord (org.apache.avro.generic.IndexedRecord)3 NetSuiteDatasetRuntime (org.talend.components.netsuite.NetSuiteDatasetRuntime)3 RecordRefList (com.netsuite.webservices.v2016_2.platform.core.RecordRefList)2 NetSuiteRuntime (org.talend.components.netsuite.NetSuiteRuntime)2 NetSuiteSource (org.talend.components.netsuite.NetSuiteSource)2 NetSuiteWebServiceMockTestFixture.assertIndexedRecord (org.talend.components.netsuite.NetSuiteWebServiceMockTestFixture.assertIndexedRecord)2 NetSuiteException (org.talend.components.netsuite.client.NetSuiteException)2 NetSuiteRuntimeImpl (org.talend.components.netsuite.v2016_2.NetSuiteRuntimeImpl)2 Account (com.netsuite.webservices.v2014_2.lists.accounting.Account)1 ExceededRequestSizeFault (com.netsuite.webservices.v2014_2.platform.ExceededRequestSizeFault)1 NetSuitePortType (com.netsuite.webservices.v2014_2.platform.NetSuitePortType)1 NetSuiteService (com.netsuite.webservices.v2014_2.platform.NetSuiteService)1 UnexpectedErrorFault (com.netsuite.webservices.v2014_2.platform.UnexpectedErrorFault)1 DataCenterUrls (com.netsuite.webservices.v2014_2.platform.core.DataCenterUrls)1 Record (com.netsuite.webservices.v2014_2.platform.core.Record)1 GetDataCenterUrlsRequest (com.netsuite.webservices.v2014_2.platform.messages.GetDataCenterUrlsRequest)1