Skip to content

Add support for struts 2.3 with tests #244

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

Merged
merged 4 commits into from
Jan 29, 2021
Merged

Add support for struts 2.3 with tests #244

merged 4 commits into from
Jan 29, 2021

Conversation

shashank11p
Copy link
Contributor

@shashank11p shashank11p commented Jan 28, 2021

resolves #218

@shashank11p shashank11p changed the title adding struts2.3 framework support tests ENG-7637 : adding struts2.3 framework support tests Jan 28, 2021
Copy link
Member

@pavolloffay pavolloffay left a comment

Choose a reason for hiding this comment

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

Nice work, left some comments, mostly related to polishing.

public static String sample = "{'balance':1000.21,'is_vip':true,'num':100,'name':'foo'}";

public String body() throws IOException {
jsonString = sample;
Copy link
Member

Choose a reason for hiding this comment

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

why do you assign it here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is just a simple logic that whenever this api is called, it assigns jsonString a value(which in our case is same every time for tests), and that jsonString is returned as response. It is defined in struts.xml to take jsonString as result.

Copy link
Member

Choose a reason for hiding this comment

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

It's more idiomatic to return the "sample" directly. Why do we need two properties jsonString and sample?


public static String sample = "{'balance':1000.21,'is_vip':true,'num':100,'name':'foo'}";

public String body() throws IOException {
Copy link
Member

Choose a reason for hiding this comment

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

Add @Override if the class overrides any method from the parent

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It does not override any method. This is our defined method which is an endpoint for /body calls.

@pavolloffay
Copy link
Member

@shashank11p in the first comment on the PR add a link to github issue that this PR is fixing e.g. #218. If you prefix it with resolves, fixes it will automatically close the issue once the PR is merged.

Could you please also list the struts in the readme?

@pavolloffay pavolloffay changed the title ENG-7637 : adding struts2.3 framework support tests Add support for struts 2.3 with tests Jan 28, 2021
@pavolloffay pavolloffay merged commit a799207 into main Jan 29, 2021
@pavolloffay pavolloffay deleted the ENG-7637/struts branch January 29, 2021 12:09
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.

Add payload and headers capture for Struts
2 participants