{"id":13712294,"url":"https://github.com/SmartBear/ready-api-testserver-samples","last_synced_at":"2025-05-06T21:33:47.605Z","repository":{"id":52843451,"uuid":"50954058","full_name":"SmartBear/ready-api-testserver-samples","owner":"SmartBear","description":"Samples projects for Ready! API TestServer usage","archived":false,"fork":false,"pushed_at":"2023-10-06T05:52:03.000Z","size":80,"stargazers_count":7,"open_issues_count":9,"forks_count":15,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-08T05:34:53.729Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SmartBear.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-02-02T21:42:42.000Z","updated_at":"2019-02-25T22:15:53.000Z","dependencies_parsed_at":"2024-05-13T00:42:58.967Z","dependency_job_id":"a29df709-22bd-44eb-948c-ac8fc7be5599","html_url":"https://github.com/SmartBear/ready-api-testserver-samples","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SmartBear%2Fready-api-testserver-samples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SmartBear%2Fready-api-testserver-samples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SmartBear%2Fready-api-testserver-samples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SmartBear%2Fready-api-testserver-samples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SmartBear","download_url":"https://codeload.github.com/SmartBear/ready-api-testserver-samples/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252772522,"owners_count":21801939,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T23:01:16.800Z","updated_at":"2025-05-06T21:33:47.255Z","avatar_url":"https://github.com/SmartBear.png","language":"Java","readme":"## Samples for Ready! API TestServer usage\n\nThis project currently contains simple projects showing how to run API tests with \nReady! API TestServer.\n\nClone this project and run 'mvn test' in the root folder; this will run each of the included modules;\n- The JUnit sample runs API tests using the java client library for TestServer\n- The Maven plugin runs API test recipes and projects provided as resources\n- The Cucumber sample \"executes\" a feature file via the java client for the TestServer \n\n### JUnit Sample\n\nIn the java/junit-client-sample folder/module; this contains a single unit test that uses the \n[TestServer Java Client](https://github.com/SmartBear/ready-api-testserver-client) to run a single request\nagainst the SwaggerHub API and assert the response. You can run this either from within your\nIDE or with maven:\n\n```\nmvn surefire:test -Dtestserver.host=... -Dtestserver.user=... -Dtestserver.password=...\n```\n\n### Maven Plugin Sample\n\nIn the java/maven-plugin-sample folder/module; this contains a single recipe that tests the SwaggerHub API \nand asserts the response. The [testserver-maven-plugin](https://github.com/olensmar/readyapi-testserver-maven-plugin) \nis configured to run as part of your integration tests when performing a mvn:install build - but you can also \ntrigger them directly with \n\n```\nmvn testserver:run -Dtestserver.host=... -Dtestserver.user=... -Dtestserver.password=...\n```\n\n### Cucumber Sample\n\nThe Declarative cucumber sample contains a simple [feature file](https://github.com/SmartBear/ready-api-testserver-samples/blob/master/java/cucumber-sample/src/test/resources/cucumber/swaggerhub.feature) for testing the SwaggerHub API \nand corresponding [step definitions](https://github.com/SmartBear/ready-api-testserver-samples/blob/master/java/cucumber-sample/src/test/java/com/smartbear/readyapi/testserver/SwaggerHubStepDefs.java) to build and execute the required recipe. \n\nFor a generic imperative approach to API Testing with Cucumber and TestServer please have a look at \nthe [testserver-cucumber](https://github.com/olensmar/testserver-cucumber) project.\n\nRunning them from the command-line with \"mvn test\" will result in the following:\n\n```\n...\n-------------------------------------------------------\n T E S T S\n-------------------------------------------------------\nRunning com.smartbear.readyapi.testserver.RunCucumberTest\nFeature: SwaggerHub REST API\n\n  Scenario: Default API Listing                         # swaggerhub.feature:2\n    When a request to the API listing is made           # SwaggerHubStepDefs.aRequestToTheAPIListing()\n    Then a list of APIs should be returned within 500ms # SwaggerHubStepDefs.aListOfAPIsShouldBeReturned(int)\n\n  Scenario: Owner API Listing                           # swaggerhub.feature:6\n    Given an owner named swagger-hub                    # SwaggerHubStepDefs.anOwnerNamed(String)\n    When a request to the API listing is made           # SwaggerHubStepDefs.aRequestToTheAPIListing()\n    Then a list of APIs should be returned within 500ms # SwaggerHubStepDefs.aListOfAPIsShouldBeReturned(int)\n\n  Scenario: API Version Listing                         # swaggerhub.feature:11\n    Given an owner named swagger-hub                    # SwaggerHubStepDefs.anOwnerNamed(String)\n    And an api named registry-api                       # SwaggerHubStepDefs.anApiNamed(String)\n    When a request to the API listing is made           # SwaggerHubStepDefs.aRequestToTheAPIListing()\n    Then a list of APIs should be returned within 500ms # SwaggerHubStepDefs.aListOfAPIsShouldBeReturned(int)\n\n  Scenario: API Retrieval                                  # swaggerhub.feature:17\n    Given an owner named swagger-hub                       # SwaggerHubStepDefs.anOwnerNamed(String)\n    And an api named registry-api                          # SwaggerHubStepDefs.anApiNamed(String)\n    And a version named 1.0.0                              # SwaggerHubStepDefs.aVersionNamed(String)\n    When a request to the API listing is made              # SwaggerHubStepDefs.aRequestToTheAPIListing()\n    Then an API definition should be returned within 500ms # SwaggerHubStepDefs.anApiDefinitionShouldBeReturned(int)\n\n4 Scenarios (4 passed)\n14 Steps (14 passed)\n0m2.136s\n\nTests run: 18, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.617 sec\n...\n```\n\n## Configuration\n\nAll the samples in this project run against the public TestServer instance available at \nhttp://testserver.readyapi.io:8080, if you want to run against your own installation you\ncan provide system properties for testserver.host, testserver.user and testserver.password \ncontaining the hostname, user and password of your TestServer installation. \n\n\n### Looking for more samples?\n\nPlease don't hesitate to raise issues in this repo to ask for more!\n","funding_links":[],"categories":["By Category"],"sub_categories":["Resources"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSmartBear%2Fready-api-testserver-samples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSmartBear%2Fready-api-testserver-samples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSmartBear%2Fready-api-testserver-samples/lists"}