Search in sources :

Example 1 with UpdateListResponse

use of com.netsuite.webservices.test.platform.messages.UpdateListResponse in project components by Talend.

the class NetSuiteClientServiceTest method testUpdateList.

@Test
public void testUpdateList() throws Exception {
    TypeDesc typeDesc = clientService.getMetaDataSource().getTypeInfo("PurchaseOrder");
    List<PurchaseOrder> recordList = makeNsObjects(new NsObjectComposer<PurchaseOrder>(clientService.getMetaDataSource(), typeDesc), 10);
    UpdateListResponse response = new UpdateListResponse();
    response.setWriteResponseList(createSuccessWriteResponseList(recordList.size()));
    when(port.updateList(notNull(UpdateListRequest.class))).thenReturn(response);
    clientService.updateList(recordList);
    verify(port, times(1)).login(notNull(LoginRequest.class));
    verify(port, times(1)).updateList(notNull(UpdateListRequest.class));
    List<NsWriteResponse<RecordRef>> writeResponses = clientService.updateList(null);
    assertTrue(writeResponses.isEmpty());
}
Also used : UpdateListResponse(com.netsuite.webservices.test.platform.messages.UpdateListResponse) UpdateListRequest(com.netsuite.webservices.test.platform.messages.UpdateListRequest) TypeDesc(org.talend.components.netsuite.client.model.TypeDesc) PurchaseOrder(com.netsuite.webservices.test.transactions.purchases.PurchaseOrder) LoginRequest(com.netsuite.webservices.test.platform.messages.LoginRequest) Test(org.junit.Test)

Aggregations

LoginRequest (com.netsuite.webservices.test.platform.messages.LoginRequest)1 UpdateListRequest (com.netsuite.webservices.test.platform.messages.UpdateListRequest)1 UpdateListResponse (com.netsuite.webservices.test.platform.messages.UpdateListResponse)1 PurchaseOrder (com.netsuite.webservices.test.transactions.purchases.PurchaseOrder)1 Test (org.junit.Test)1 TypeDesc (org.talend.components.netsuite.client.model.TypeDesc)1