hedera-mirror-node icon indicating copy to clipboard operation
hedera-mirror-node copied to clipboard

Port REST specs to Java, phase 1

Open jascks opened this issue 1 year ago • 2 comments

Description: To confidently be able to port over existing JavaScript REST APIs to Java, we need to ensure the existing spec tests continue to work against the newly converted API.

  • Add a RestSpecTest that
    • Injects and uses a RestClient similar to ControllerTest
    • Can load JSON spec files from hedera-mirror-rest-java/src/test/resources/specs with arbitrary depths. For this phase 1 PR, a selected few spec files are choosen.
    • Model the spec JSON as a RestSpec POJO
    • For each spec, use DomainBuilder to create default and override with data from setup section and persist
    • Call the URLs and verify the response JSON and status codes
    • Temporarily add a hedera-mirror-rest test container to verify all specs pass against it

Related issue(s):

Fixes #6810

Notes for reviewer: This branch/PR is a step back from the branch 6810-port-rest-specs-to-java which contains additional functionality regarding additional DB entity types for setup. That will be the basis for follow on work to build on this phase 1 PR.

Checklist

  • [ ] Documented (Code comments, README, etc.)
  • [x] Tested (unit, integration, etc.)

jascks avatar Jul 18 '24 15:07 jascks