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