Skip to content
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

Conversation

tschlat
Copy link
Collaborator

@tschlat tschlat commented Dec 16, 2021

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.

@bbortt bbortt force-pushed the issue/821/access-variable-by-xpath-json branch from 203527e to def6130 Compare December 16, 2021 15:42
public class JsonPathSegmentVariableExtractorIT extends TestNGCitrusSpringSupport {

@Test
@CitrusXmlTest
Copy link
Collaborator

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

@bbortt
Copy link
Collaborator

bbortt commented Dec 16, 2021

@tschlat pretty cool enhancement! but the build didn't like your changes..

Copy link
Collaborator Author

@tschlat tschlat left a 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.

Copy link
Member

@christophd christophd left a 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

@tschlat tschlat force-pushed the issue/821/access-variable-by-xpath-json branch 2 times, most recently from 0561a18 to cb553a6 Compare December 20, 2021 09:36
@tschlat
Copy link
Collaborator Author

tschlat commented Dec 20, 2021

I have added a commit with the needed changes identified by @christophd

Copy link
Collaborator Author

@tschlat tschlat left a 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

@christophd
Copy link
Member

LGTM Many thanks! Unit tests in CI job failing though

@tschlat
Copy link
Collaborator Author

tschlat commented Dec 22, 2021

@christophd please carefully check changes of this commit which I provided as fix to issue#831

@tschlat
Copy link
Collaborator Author

tschlat commented Dec 22, 2021

@christophd please carefully check changes on this commit which I provided as fix to issue#832.

@tschlat tschlat force-pushed the issue/821/access-variable-by-xpath-json branch 2 times, most recently from 6203c8a to 2786da3 Compare December 22, 2021 13:55
@tschlat tschlat requested a review from christophd December 22, 2021 13:56
Copy link
Collaborator

@bbortt bbortt left a 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 🎄

@@ -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) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @tschlat! that's the right one - follow up for #817. my bad.

Copy link
Member

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.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see #840.

@tschlat
Copy link
Collaborator Author

tschlat commented Dec 23, 2021

@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)

Copy link
Collaborator

@bbortt bbortt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm, many thanks.

@christophd
Copy link
Member

@tschlat sorry, did not make it before the holidays. just started the workflow

Copy link
Member

@christophd christophd left a 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

@tschlat tschlat force-pushed the issue/821/access-variable-by-xpath-json branch 3 times, most recently from 376bedd to 5e8923c Compare January 17, 2022 09:01
Thorsten Schlathölter added 4 commits January 17, 2022 10:13
…ntent when encod. base64

- Adjusted file.txt
  - to only contain constant expressions (currentDate())
  - Removed newLine to support testing on windows
@tschlat tschlat force-pushed the issue/821/access-variable-by-xpath-json branch from 5e8923c to d195eca Compare January 17, 2022 09:20
@tschlat
Copy link
Collaborator Author

tschlat commented Jan 18, 2022

@christophd magst Du noch mal meinen Change für #831 reviewen und den Workflow noch mal triggern?

@bbortt
Copy link
Collaborator

bbortt commented Jan 19, 2022

@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.

@christophd
Copy link
Member

@bbortt @tschlat we have a green build! 🥳 @tschlat do you still want to squash and reorganize the commits before merge?

Tests that fail on os=win

fix(837): Fix platform specific test failures

Tests that fail on os=win
@tschlat tschlat force-pushed the issue/821/access-variable-by-xpath-json branch from ab01258 to 516ce14 Compare January 25, 2022 06:09
@tschlat
Copy link
Collaborator Author

tschlat commented Jan 25, 2022

@bbortt @tschlat we have a green build! 🥳 @tschlat do you still want to squash and reorganize the commits before merge?

This has already been done. I have a commit per issue. Any objections?

@tschlat
Copy link
Collaborator Author

tschlat commented Jan 25, 2022

@christophd could you make me a maintainer so that I can trigger the build myself?

@bbortt
Copy link
Collaborator

bbortt commented Jan 25, 2022

@christophd could you make me a maintainer so that I can trigger the build myself?

I can help you.. just ping me 😉

@christophd christophd merged commit f6359fc into citrusframework:main Jan 25, 2022
@bbortt bbortt deleted the issue/821/access-variable-by-xpath-json branch January 25, 2022 07:50
@bbortt
Copy link
Collaborator

bbortt commented Jan 25, 2022

thanks @christophd 🚀

@tschlat
Copy link
Collaborator Author

tschlat commented Jan 25, 2022

Yes thanks a lot for the support @christophd

@tschlat
Copy link
Collaborator Author

tschlat commented Jan 25, 2022

and @bbortt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants