Search in sources :

Example 1 with DeleteListResponse

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());
}
Also used : DeleteListRequest(com.netsuite.webservices.test.platform.messages.DeleteListRequest) DeleteListResponse(com.netsuite.webservices.test.platform.messages.DeleteListResponse) TypeDesc(org.talend.components.netsuite.client.model.TypeDesc) RecordRef(com.netsuite.webservices.test.platform.core.RecordRef) LoginRequest(com.netsuite.webservices.test.platform.messages.LoginRequest) Test(org.junit.Test)

Aggregations

RecordRef (com.netsuite.webservices.test.platform.core.RecordRef)1 DeleteListRequest (com.netsuite.webservices.test.platform.messages.DeleteListRequest)1 DeleteListResponse (com.netsuite.webservices.test.platform.messages.DeleteListResponse)1 LoginRequest (com.netsuite.webservices.test.platform.messages.LoginRequest)1 Test (org.junit.Test)1 TypeDesc (org.talend.components.netsuite.client.model.TypeDesc)1