use of com.netsuite.webservices.v2014_2.platform.messages.GetResponse in project components by Talend.
the class NetSuiteMockTestBase method mockGetRequestResults.
protected <T extends Record> void mockGetRequestResults(final T record) throws Exception {
final NetSuitePortType port = webServiceMockTestFixture.getPortMock();
when(port.get(any(GetRequest.class))).then(new Answer<GetResponse>() {
@Override
public GetResponse answer(InvocationOnMock invocationOnMock) throws Throwable {
GetResponse response = new GetResponse();
ReadResponse readResponse = new ReadResponse();
readResponse.setStatus(createSuccessStatus());
readResponse.setRecord(record);
response.setReadResponse(readResponse);
return response;
}
});
}
use of com.netsuite.webservices.v2014_2.platform.messages.GetResponse in project components by Talend.
the class NetSuiteMockTestBase method mockGetRequestResults.
protected <T extends Record> void mockGetRequestResults(final T record) throws Exception {
final NetSuitePortType port = webServiceMockTestFixture.getPortMock();
when(port.get(any(GetRequest.class))).then(new Answer<GetResponse>() {
@Override
public GetResponse answer(InvocationOnMock invocationOnMock) throws Throwable {
GetResponse response = new GetResponse();
ReadResponse readResponse = new ReadResponse();
if (record != null) {
readResponse.setStatus(createSuccessStatus());
} else {
readResponse.setStatus(createNotFoundStatus());
}
readResponse.setRecord(record);
response.setReadResponse(readResponse);
return response;
}
});
}
Aggregations