• <legend id='zqvCh'><style id='zqvCh'><dir id='zqvCh'><q id='zqvCh'></q></dir></style></legend>

      • <bdo id='zqvCh'></bdo><ul id='zqvCh'></ul>

    1. <i id='zqvCh'><tr id='zqvCh'><dt id='zqvCh'><q id='zqvCh'><span id='zqvCh'><b id='zqvCh'><form id='zqvCh'><ins id='zqvCh'></ins><ul id='zqvCh'></ul><sub id='zqvCh'></sub></form><legend id='zqvCh'></legend><bdo id='zqvCh'><pre id='zqvCh'><center id='zqvCh'></center></pre></bdo></b><th id='zqvCh'></th></span></q></dt></tr></i><div id='zqvCh'><tfoot id='zqvCh'></tfoot><dl id='zqvCh'><fieldset id='zqvCh'></fieldset></dl></div>
      1. <small id='zqvCh'></small><noframes id='zqvCh'>

        <tfoot id='zqvCh'></tfoot>

        我可以在 Citrus 静态响应适配器有效负载中使用

        时间:2023-07-28

        <i id='DMYRH'><tr id='DMYRH'><dt id='DMYRH'><q id='DMYRH'><span id='DMYRH'><b id='DMYRH'><form id='DMYRH'><ins id='DMYRH'></ins><ul id='DMYRH'></ul><sub id='DMYRH'></sub></form><legend id='DMYRH'></legend><bdo id='DMYRH'><pre id='DMYRH'><center id='DMYRH'></center></pre></bdo></b><th id='DMYRH'></th></span></q></dt></tr></i><div id='DMYRH'><tfoot id='DMYRH'></tfoot><dl id='DMYRH'><fieldset id='DMYRH'></fieldset></dl></div>
          <tbody id='DMYRH'></tbody>

          • <legend id='DMYRH'><style id='DMYRH'><dir id='DMYRH'><q id='DMYRH'></q></dir></style></legend>

                <bdo id='DMYRH'></bdo><ul id='DMYRH'></ul>
              • <tfoot id='DMYRH'></tfoot>

                  <small id='DMYRH'></small><noframes id='DMYRH'>

                  本文介绍了我可以在 Citrus 静态响应适配器有效负载中使用 Citrus 变量吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我正在使用静态响应端点适配器返回从资源文件中获取的模拟服务响应:

                  I am using static response endpoint adapter to return a mock service response taken from a resource file:

                              private void setAdapterResponse(StaticResponseEndpointAdapter adapter, String response) throws IOException{
                  
                                              URL url = Resources.getResource(response);
                                              adapter.setMessagePayload(Resources.toString(url, Charsets.UTF_8));
                              }
                  
                              @Autowired
                              private Endpoint helloSoapClient;
                  
                              @Autowired
                              private WebServiceServer helloMockService;
                  
                              @Autowired
                              private StaticResponseEndpointAdapter helloResponseAdapter;
                  
                              @CitrusTest(name = "HELLO_WORLD")
                              public void sendAndReceiveMessage() throws IOException{
                  
                                              variable("randomRequestIdentifier", "9978111203033");
                                              variable("constantDate", "201301010000");
                  
                                              setAdapterResponse(helloResponseAdapter, "templates/helloResponses/ReqIdGenerator.xml");
                  
                                              send(helloSoapClient)
                                              .payload(new ClassPathResource("templates/helloRequests/HelloRequest028.xml"));
                                              receive(helloSoapClient)
                                              .payload(new ClassPathResource("templates/helloResponses/HelloResponse028.xml"));
                              }
                  
                  
                  
                              private void setAdapterResponse(StaticResponseEndpointAdapter adapter, String response) throws IOException{
                  
                              URL url = Resources.getResource(response);
                              adapter.setMessagePayload(Resources.toString(url, Charsets.UTF_8));
                              }
                  

                  文件templates/helloResponses/ReqIdGenerator.xml 内容为:

                  the file templates/helloResponses/ReqIdGenerator.xml contents is:

                  <xml>
                    <id>${randomRequestIdentifier}</id>
                  </xml>
                  

                  我认为应该将变量替换为其当前值.我错了吗?是否有内置机制来支持 Citrus 端点响应中的变量?

                  I thought that variable should be replaced with its current value. Am I wrong? Is there a build-in mechanism to support variables in Citrus Endpoint Responses?

                  推荐答案

                  目前静态响应适配器和端点适配器一般不支持测试变量.

                  The static response adapter and endpoint adapters in general do not support test variables at the moment.

                  编辑:从 Citrus 2.6.2 开始,您可以在静态响应适配器中使用测试变量.请参阅此处的文档:http://www.citrusframework.org/reference/html/endpoint-adapter.html#static-response-endpoint-adapter

                  这篇关于我可以在 Citrus 静态响应适配器有效负载中使用 Citrus 变量吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:使用 Maven 配置文件构建两个不同的版本并从 Ec 下一篇:禁止基于 Maven 的持续集成构建的 GPG 签名 (Travi

                  相关文章

                  最新文章

                    <legend id='kWDgy'><style id='kWDgy'><dir id='kWDgy'><q id='kWDgy'></q></dir></style></legend>

                      <small id='kWDgy'></small><noframes id='kWDgy'>

                      <i id='kWDgy'><tr id='kWDgy'><dt id='kWDgy'><q id='kWDgy'><span id='kWDgy'><b id='kWDgy'><form id='kWDgy'><ins id='kWDgy'></ins><ul id='kWDgy'></ul><sub id='kWDgy'></sub></form><legend id='kWDgy'></legend><bdo id='kWDgy'><pre id='kWDgy'><center id='kWDgy'></center></pre></bdo></b><th id='kWDgy'></th></span></q></dt></tr></i><div id='kWDgy'><tfoot id='kWDgy'></tfoot><dl id='kWDgy'><fieldset id='kWDgy'></fieldset></dl></div>
                        <bdo id='kWDgy'></bdo><ul id='kWDgy'></ul>
                      <tfoot id='kWDgy'></tfoot>