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