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

Fixes POST without accept for 3 endpoints #199

Merged
merged 5 commits into from
Apr 2, 2020

Conversation

jakesmolka
Copy link
Contributor

@jakesmolka jakesmolka commented Mar 23, 2020

Fixes default values and adds test for POST ehr, composition and
contribution.

Changes

  • Fixes POST without accept for 3 endpoints
    • Fixes default values and adds test for POST ehr, composition and
      contribution.

More details on test changes:

POST ehr:

  • existing MF-001 - Create new EHR (w/o Prefer header) already does check it. Renamed to MF-001 - Create new EHR (w/o Prefer and Accept header) to prevent accently refacotring away from that feature.

POST composition:

  • created new commit composition without accept header keyword which basically is a copy of the normal one, but without Accept header.
  • used in new Main flow has existing COMPOSITION and works without accept header test case

POST contribution:

  • created new POST /ehr/ehr_id/contribution without accept header (... like above)
  • used by newly created commit CONTRIBUTION without accept header (... like above)
  • used in new Main flow: successfully commit CONTRIBUTION with single valid VERSION<COMPOSITION> withtout accept header test case

KW prepare new request session refactored:

  • Requests can now be triggered w/ or w/o Accept/Content-Type headers
  • JSON (default) - both (accept and content-type) set to application/json
  • XML (both set to application/xml)
  • no accept header (content-type=application/json)
  • no content header
  • no accept header xml (content-type=application/xml)
  • no accept/content-type headers (other 'extra_headers' like IF-Match still possible)
  • no headers

Related issue

fixes https://github.com/ehrbase/project_management/issues/175

Additional information and checks

  • Pull request linked in changelog

Fixes default values and adds test for POST ehr, composition and
contribution.

see: https://github.com/ehrbase/project_management/issues/175
@testautomation
Copy link
Contributor

testautomation commented Mar 31, 2020

@jakesmolka

  1. I found an issue which requires me to refactor an existing keyword or add and additional keyword. FYI: prepare request session KW sets Content and Accept headers to application/json even if called w/o format argument (JSON).

Requests can now be triggert w/ or w/o Accept and Content-Type headers

- JSON (default)
- XML
- no accept header
- no content header
- no accept header, content-type=xml
 - no accept/content-type headers
- no headers
Copy link
Contributor

@testautomation testautomation left a comment

Choose a reason for hiding this comment

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

@jakesmolka I had to use a little workaround where I set headers that should not be used to null. This should have the same effect as if that headers were not provided at all. I had to do this because one of the libraries we use (RESTInstance) sets some headers by default and does not provide an option to remove these defaults - they can only be overwritten. So something like Remove From Dictionary ${headers} Accept which you used for a RequestsLibrary request (i.e. here) does not work in case of RESTInsatance lib.

image

@testautomation testautomation removed their assignment Mar 31, 2020
@jakesmolka jakesmolka changed the title WIP: Fixes POST without accept for 3 endpoints Fixes POST without accept for 3 endpoints Apr 2, 2020
@jakesmolka jakesmolka merged commit ac0b933 into develop Apr 2, 2020
@testautomation testautomation deleted the feature/175_post_without_accept branch April 6, 2020 14:31
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.

None yet

2 participants