use of com.netsuite.webservices.test.platform.messages.AddResponse in project components by Talend.
the class NetSuiteClientServiceTest method testAdd.
@Test
public void testAdd() throws Exception {
TypeDesc typeDesc = clientService.getMetaDataSource().getTypeInfo("PurchaseOrder");
PurchaseOrder record = new NsObjectComposer<PurchaseOrder>(clientService.getMetaDataSource(), typeDesc).composeObject();
AddResponse response = new AddResponse();
response.setWriteResponse(createSuccessWriteResponse());
when(port.add(notNull(AddRequest.class))).thenReturn(response);
clientService.add(record);
verify(port, times(1)).login(notNull(LoginRequest.class));
verify(port, times(1)).add(notNull(AddRequest.class));
NsWriteResponse writeResponse = clientService.add(null);
assertNull(writeResponse.getStatus());
assertNull(writeResponse.getRef());
}
Aggregations