citrus-framework

Citrus XPath Validation Cannot Find Element

时光怂恿深爱的人放手 提交于 2019-12-24 18:28:27
问题 I have an XML payload with the element ValidationFault . Part of my validation is to confirm the ValidationFault element occurs only once in the XML payload. Using the following Citrus Java DSL: runner.receive(action -> action.endpoint(endpointName) .validate("number://ValidationFault", 1)); I do not get back the expected value of 1, instead 0: com.consol.citrus.exceptions.TestCaseFailedException: Validation failed: Values not equal for element '//ValidationFault', expected '1' but was '0' I

Receiving messages from tcp server with Citrus framework and Spring Integration times out

我的未来我决定 提交于 2019-12-23 21:16:32
问题 I am trying to test a simple tcp send/receive sequence making use of citrus framework. I am able to send messages fine but receiving messages proves problematic. Basically, the reply is not detected by citrus and citrus then times out. Citrus bean configuration: <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:citrus="http://www.citrusframework.org/schema/config" xmlns:int="http://www

Simultanous sending and receiving

狂风中的少年 提交于 2019-12-14 03:04:14
问题 I am trying to send and receive message to and from JMS topics. <testcase name="DeliveryToPT3PLIT"> ... <actions> ... <send endpoint="fromEndpoint"> <message> <resource file="com/roche/icc/citrus/messages/input/PT-3PLWoBatchSplit.xml"/> </message> <header> ... </header> </send> <receive endpoint="toEndpoint"> <description>Receive asynchronous message from topic</description> <message> <resource file="com/roche/icc/citrus/messages/output/PT-3PLWoBatchSplit.xml"/> </message> <header> ... <

Citrus Framework - Can a variable be assigned from a response?

为君一笑 提交于 2019-12-11 06:07:20
问题 I'm trying to test the following two REST calls: Request 1 GET getLatestVersion Response: {"version": 10} Request 2 POST getVersionData (body={"version": 10}) Response: {"version": 10, data: [...]} Is it possible to assign the "version" from Request 1 to a variable to use in Request 2 within the same test? @CitrusTest(name = "SimpleIT.getVersionTest") public void getVersionTest() { // Request 1 http() .client("restClient") .send() .get("/getLatestVersion") .accept("application/json"); http()

How should i pass variable extracted From Payload thru test classes?

被刻印的时光 ゝ 提交于 2019-12-03 23:10:00
问题 I'm using Citrus Framevork and have some pre-test steps to get auth-token and then use it in whole test plan. And don't clearly understand usage of TestContext in this case and how to access var. thru several testIT classes: GetTokenIT.java: http() .client(HttpTqaClient) .receive() .response(HttpStatus.OK) .messageType(MessageType.JSON) .extractFromHeader("Authorization", "header_token") .extractFromPayload("$.id_token", "payload_token"); action(new AbstractTestAction() { @Override public

Can I use Citrus variable in Citrus static response adapter payload?

爱⌒轻易说出口 提交于 2019-12-02 14:44:59
问题 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;

Can I use Citrus variable in Citrus static response adapter payload?

风流意气都作罢 提交于 2019-12-02 10:10:43
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(

How should i pass variable extracted From Payload thru test classes?

十年热恋 提交于 2019-12-01 01:57:49
I'm using Citrus Framevork and have some pre-test steps to get auth-token and then use it in whole test plan. And don't clearly understand usage of TestContext in this case and how to access var. thru several testIT classes: GetTokenIT.java: http() .client(HttpTqaClient) .receive() .response(HttpStatus.OK) .messageType(MessageType.JSON) .extractFromHeader("Authorization", "header_token") .extractFromPayload("$.id_token", "payload_token"); action(new AbstractTestAction() { @Override public void doExecute(TestContext context) { String token = context.getVariable("payload_token"); System.out