response.setMockResponseName(mockResponse.getName()); response.setHttpHeaders(mockResponse.getHttpHeaders()); response.setHttpStatusCode(mockResponse.getHttpStatusCode()); response.setContentEncodings(mockResponse.getContentEncodings()); return response;
Assert.assertEquals(mockResponse.getStatus(), returnedSoapMockResponse.getStatus()); Assert.assertEquals(mockResponse.getBody(), returnedSoapMockResponse.getBody()); Assert.assertEquals(mockResponse.getHttpStatusCode(), returnedSoapMockResponse.getHttpStatusCode()); Assert.assertEquals(mockResponse.getStatus(), returnedSoapMockResponse.getStatus()); Assert.assertEquals(mockResponse.isUsingExpressions(), returnedSoapMockResponse.isUsingExpressions());
/** * The process message is responsible for processing an incoming serviceTask and generate * a response based on the incoming serviceTask input * @param serviceTask The serviceTask that will be processed by the service * @return A result based on the processed incoming serviceTask * @see ServiceTask * @see ServiceResult */ @Override public ServiceResult<UpdateSoapMockResponseOutput> process(final ServiceTask<UpdateSoapMockResponseInput> serviceTask) { final UpdateSoapMockResponseInput input = serviceTask.getInput(); final SoapMockResponse updated = input.getMockResponse(); final SoapMockResponse mockResponse = this.mockResponseRepository.findOne(input.getMockResponseId()); mockResponse.setName(updated.getName()); mockResponse.setBody(updated.getBody()); mockResponse.setHttpStatusCode(updated.getHttpStatusCode()); mockResponse.setStatus(updated.getStatus()); mockResponse.setHttpHeaders(updated.getHttpHeaders()); mockResponse.setUsingExpressions(updated.isUsingExpressions()); mockResponse.setXpathExpressions(updated.getXpathExpressions()); final SoapMockResponse updatedSoapMockResponse = mockResponseRepository.update(input.getMockResponseId(), mockResponse); return createServiceResult(UpdateSoapMockResponseOutput.builder() .mockResponse(updatedSoapMockResponse) .build()); } }