/// IMPORT ////////////// import net.ihe.gazelle.wstester.mockrecord.Message import net.ihe.gazelle.wstester.mockrecord.MessageRecorder import static net.ihe.gazelle.wstester.mockrecord.EStandard.OTHER import java.nio.charset.StandardCharsets ///////////////////////////////////// ///////////////////////////////////// def simulatedActorKeyword = "CH:ADR_PROVIDER" def domainKeyword = "EPR" def transactionKeyword = "CH:ADR" def responder_ip = "ADRProviderSimulator" def requestType = "XACMLAuthzDecisionQuery" def responseType = "soapFault" ///////////////////////////////////// ///////////////////////////////////// def request = mockRequest.requestContent; def response = mockResponse.responseContent; def sender_ip = mockRequest.getHttpRequest().getRemoteAddr() /////// CAN BE CHANGED ACCORDING TO THE PROPERTIES USED IN THE RESPONSE //////////////////////////////////////////////////////////////////////// response = response.replace('${#MockService#soapFaultReason}', context.mockService.getPropertyValue('soapFaultReason')) response = response.replace('${#MockService#soapFaultCodeValue}', context.mockService.getPropertyValue('soapFaultCodeValue')) //////// log.info "test" byte[] byte_request = request.getBytes(StandardCharsets.UTF_8) byte[] byte_response = response.getBytes(StandardCharsets.UTF_8) MessageRecorder messageRecorder = new MessageRecorder("jdbc:postgresql://localhost:5432/gazelle-webservice-tester", "gazelle", "gazelle") Message requestMessage = new Message(sender_ip, sender_ip, requestType, simulatedActorKeyword, byte_request) Message responseMessage = new Message(responder_ip, responder_ip, responseType, simulatedActorKeyword, byte_response) messageRecorder.record(OTHER, transactionKeyword, domainKeyword, simulatedActorKeyword, requestMessage, responseMessage)