-
Notifications
You must be signed in to change notification settings - Fork 138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue/821/access variable by xpath json #827
Issue/821/access variable by xpath json #827
Conversation
203527e
to
def6130
Compare
core/citrus-api/src/main/java/com/consol/citrus/variable/SegmentVariableExtractorRegistry.java
Outdated
Show resolved
Hide resolved
core/citrus-api/src/main/java/com/consol/citrus/variable/SegmentVariableExtractor.java
Outdated
Show resolved
Hide resolved
core/citrus-api/src/main/java/com/consol/citrus/variable/VariableExpressionSegmentMatcher.java
Outdated
Show resolved
Hide resolved
public class JsonPathSegmentVariableExtractorIT extends TestNGCitrusSpringSupport { | ||
|
||
@Test | ||
@CitrusXmlTest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just had an idea.. could we have the @Ignore
of the "no empty test methods" sonar rule on the @CitrusXmlTest
annotation? :D
...citrus-validation-xml/src/main/java/com/consol/citrus/xml/XpathSegmentVariableExtractor.java
Show resolved
Hide resolved
...citrus-validation-xml/src/main/java/com/consol/citrus/xml/XpathSegmentVariableExtractor.java
Outdated
Show resolved
Hide resolved
...citrus-validation-xml/src/main/java/com/consol/citrus/xml/XpathSegmentVariableExtractor.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Included feedback of bbortt.
...citrus-validation-xml/src/main/java/com/consol/citrus/xml/XpathSegmentVariableExtractor.java
Outdated
Show resolved
Hide resolved
core/citrus-api/src/main/java/com/consol/citrus/variable/SegmentVariableExtractor.java
Outdated
Show resolved
Hide resolved
core/citrus-api/src/main/java/com/consol/citrus/variable/VariableExpressionSegmentMatcher.java
Outdated
Show resolved
Hide resolved
...citrus-validation-xml/src/main/java/com/consol/citrus/xml/XpathSegmentVariableExtractor.java
Show resolved
Hide resolved
...citrus-validation-xml/src/main/java/com/consol/citrus/xml/XpathSegmentVariableExtractor.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really a great enhancement! Many thanks! I like the configuration via resource lookup, well done!
I'd just argue the document caching mechanism and we need to also add this to Spring based configuration
...itrus-api/src/test/java/com/consol/citrus/variable/VariableExpressionSegmentMatcherTest.java
Outdated
Show resolved
Hide resolved
...citrus-validation-xml/src/main/java/com/consol/citrus/xml/XpathSegmentVariableExtractor.java
Outdated
Show resolved
Hide resolved
...citrus-validation-xml/src/main/java/com/consol/citrus/xml/XpathSegmentVariableExtractor.java
Outdated
Show resolved
Hide resolved
core/citrus-base/src/main/java/com/consol/citrus/context/TestContextFactory.java
Show resolved
Hide resolved
0561a18
to
cb553a6
Compare
I have added a commit with the needed changes identified by @christophd |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added fixes for your review @christophd
...citrus-validation-xml/src/main/java/com/consol/citrus/xml/XpathSegmentVariableExtractor.java
Outdated
Show resolved
Hide resolved
LGTM Many thanks! Unit tests in CI job failing though |
@christophd please carefully check changes of this commit which I provided as fix to issue#831 |
@christophd please carefully check changes on this commit which I provided as fix to issue#832. |
6203c8a
to
2786da3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a review for christmas 🎄
...citrus-base/src/test/java/com/consol/citrus/functions/core/ReadFileResourceFunctionTest.java
Outdated
Show resolved
Hide resolved
core/citrus-api/src/main/java/com/consol/citrus/util/IsJsonPredicate.java
Outdated
Show resolved
Hide resolved
core/citrus-api/src/main/java/com/consol/citrus/util/IsXmlPredicate.java
Outdated
Show resolved
Hide resolved
core/citrus-api/src/main/java/com/consol/citrus/variable/VariableExpressionIterator.java
Outdated
Show resolved
Hide resolved
core/citrus-api/src/main/java/com/consol/citrus/variable/VariableExpressionSegmentMatcher.java
Outdated
Show resolved
Hide resolved
@@ -26,7 +27,7 @@ public HttpClientActionBuilder client(String httpClient) { | |||
return new HttpClientActionBuilder(delegate.client(httpClient)); | |||
} | |||
|
|||
public HttpServerActionBuilder server(HttpServer httpServer) { | |||
public HttpServerActionBuilder server(Endpoint httpServer) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, that's the right place. 👍
@bbortt what about reverting the changes made in #817? I think the builder should only accept HttpServer endpoints. I need to review the use case in the citrus-simulator to understand why another endpoint type is required here.
It is ok to provide the Endpoint option in the vintage modules but I think using the builder with generic endpoint type is not the way we should go in the long run.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see #840.
@bbortt I accepted all your suggestions. @christophd if you could have a look at the two commits concerning other issues and could kick the workflow we could eventually make it for christmas. If approved, I will squash and reorganize the commits into three commits namely: fix(#820), fix(#821) and fix(#832) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm, many thanks.
@tschlat sorry, did not make it before the holidays. just started the workflow |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see a problem with non textual file content and the variable replacement. I have described in more detail in the comments
core/citrus-base/src/main/java/com/consol/citrus/functions/core/ReadFileResourceFunction.java
Outdated
Show resolved
Hide resolved
core/citrus-base/src/main/java/com/consol/citrus/functions/core/ReadFileResourceFunction.java
Outdated
Show resolved
Hide resolved
376bedd
to
5e8923c
Compare
…ntent when encod. base64 - Adjusted file.txt - to only contain constant expressions (currentDate()) - Removed newLine to support testing on windows
…ather than HttpServer
5e8923c
to
d195eca
Compare
@christophd magst Du noch mal meinen Change für #831 reviewen und den Workflow noch mal triggern? |
@christophd maybe one of us (@tschlat or me) can be maintainer here as well as in citrusframework/citrus-simulator? would be faster for us, if we could trigger the workflow ourselfs. |
endpoints/citrus-ws/src/main/java/com/consol/citrus/ws/message/SoapAttachment.java
Outdated
Show resolved
Hide resolved
Tests that fail on os=win fix(837): Fix platform specific test failures Tests that fail on os=win
ab01258
to
516ce14
Compare
@christophd could you make me a maintainer so that I can trigger the build myself? |
I can help you.. just ping me 😉 |
thanks @christophd 🚀 |
Yes thanks a lot for the support @christophd |
and @bbortt |
Added the feature requested with issue #821.
I have implemented the feature into the changes of #820.
The code got more complex than I thought it would get. The reason is the separation of JsonPath/Xpath functionality into different modules. So I wasn't able to access the JSonPath/Xpath utillities from the api-module that hosts the TestContext. I had to decouple the extraction mechanism for JsonPath and Xpath into the modules. Although there is a bunch of new files, the implemented approach pretty much follows the decoupling mechanisms already used thought the framework.
There is one toDo in com.consol.citrus.xml.XpathSegmentVariableExtractor for which I request advice from you @christophd.