/// IMPORT ////////////// import net.ihe.gazelle.wstester.mockrecord.Message import net.ihe.gazelle.wstester.mockrecord.MessageRecorder import static net.ihe.gazelle.wstester.mockrecord.EStandard.* 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 = "Response" ///////////////////////////////////// ///////////////////////////////////// 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#uuid2}', context.mockService.getPropertyValue('uuid2')) response = response.replace('${#MockService#uuid1}', context.mockService.getPropertyValue('uuid1')) response = response.replace('${#MockService#issueInstance}', context.mockService.getPropertyValue('issueInstance')) response = response.replace('${#MockService#Status_Code}', context.mockService.getPropertyValue('Status_Code')) response = response.replace('${#MockService#issueInstance}', context.mockService.getPropertyValue('issueInstance')) response = response.replace('${#MockService#community}', context.mockService.getPropertyValue('community')) response = response.replace('${#MockService#result}', context.mockService.getPropertyValue('result')) //////// 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)