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