use of com.netsuite.webservices.test.platform.messages.AddListResponse in project components by Talend.
the class NetSuiteClientServiceTest method testAddList.
@Test
public void testAddList() throws Exception {
TypeDesc typeDesc = clientService.getMetaDataSource().getTypeInfo("PurchaseOrder");
List<PurchaseOrder> recordList = makeNsObjects(new NsObjectComposer<PurchaseOrder>(clientService.getMetaDataSource(), typeDesc), 10);
AddListResponse response = new AddListResponse();
response.setWriteResponseList(createSuccessWriteResponseList(recordList.size()));
when(port.addList(notNull(AddListRequest.class))).thenReturn(response);
clientService.addList(recordList);
verify(port, times(1)).login(notNull(LoginRequest.class));
verify(port, times(1)).addList(notNull(AddListRequest.class));
List<NsWriteResponse<RecordRef>> writeResponses = clientService.addList(null);
assertTrue(writeResponses.isEmpty());
}
Aggregations