{"id":21300902,"url":"https://github.com/mehdi-reza/api-automation","last_synced_at":"2026-01-01T21:56:52.541Z","repository":{"id":39944876,"uuid":"239778967","full_name":"mehdi-reza/api-automation","owner":"mehdi-reza","description":"A utility for api automation","archived":false,"fork":false,"pushed_at":"2023-12-05T22:25:22.000Z","size":53,"stargazers_count":0,"open_issues_count":3,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-15T18:27:29.456Z","etag":null,"topics":["api-automation","automation","integration-tests","junit","maven","qa","restassured","swagger"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mehdi-reza.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2020-02-11T14:15:59.000Z","updated_at":"2020-02-20T13:33:13.000Z","dependencies_parsed_at":"2025-01-22T08:11:20.328Z","dependency_job_id":"80cc307f-862d-4213-88b8-b2c7f088aa04","html_url":"https://github.com/mehdi-reza/api-automation","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mehdi-reza/api-automation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mehdi-reza%2Fapi-automation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mehdi-reza%2Fapi-automation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mehdi-reza%2Fapi-automation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mehdi-reza%2Fapi-automation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mehdi-reza","download_url":"https://codeload.github.com/mehdi-reza/api-automation/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mehdi-reza%2Fapi-automation/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28164085,"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","status":"online","status_checked_at":"2026-01-01T02:00:06.694Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["api-automation","automation","integration-tests","junit","maven","qa","restassured","swagger"],"created_at":"2024-11-21T15:42:13.594Z","updated_at":"2026-01-01T21:56:52.513Z","avatar_url":"https://github.com/mehdi-reza.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# api-automation\n\n[![CircleCI](https://circleci.com/gh/mehdi-reza/api-automation.svg?style=shield)](https://circleci.com/gh/mehdi-reza/api-automation) [![Coverage Status](https://coveralls.io/repos/github/mehdi-reza/api-automation/badge.svg)](https://coveralls.io/github/mehdi-reza/api-automation)\n\nIt uses swagger.json to find out all available operations and required parameters.\n\nSee sample/src/test/java/tez/TestScenario1.java. The test data is defined in src/test/resources/scenario.1.res and annotated in test class.\n\nA JUnit test is defined as following:\n\n```\n@Scenario(resource = \"scenario.1.res\")\n@TestMethodOrder(OrderAnnotation.class)\npublic class TestScenario1 extends ScenarioRunner {\n\n  private Logger logger = LoggerFactory.getLogger(TestScenario1.class);\n  \n  @Test\n  @Order(1)\n  public void testGetByPetId() {\n    logger.info(\"testGetByPetId\");\n  \n    // returns as restassured Response\n    Response response = callApi(\"get:/pet/{petId}\");\n\t\t\n    // get a validatable response and assert\n    response.then().body(\"name\", is(\"Trump\"));\n  \n    // save for later use in other test method\n    push(\"name\", response.getBody().as(JsonObject.class, ObjectMapperType.GSON).get(\"name\").getAsString());\n    logger.debug(response.asString());\n  }\n  \n  @Test\n  @Order(2)\n  public void testFindByStatus() {\n    logger.info(\"testFindByStatus\");\n\t\t\n    logger.info(\"peek(\\\"name\\\") returns {}\", peek(\"name\"));\n\t\t\n    String response = callApi(\"get:/pet/findByStatus\").asString();\n    logger.debug(response);\n  }\n  \n}\n```\nRead further on assertions https://github.com/rest-assured/rest-assured/wiki/usage\n\n## Test data\n\n```\n[\n    \"post:/pet/{petId}/uploadImage\",\n    {\n        \"consumes\": \"application/json\",\n    \t\"produces\": \"application/json\",\n    \t\"headers\": {},\n        \"data\": {\n\t  \"petId\": 1,\n\t  \"name\": \"Pet name\"\n        }\n    },\n    \n    \"get:/pet/{petId}\", \n    {\n    \t\"consumes\": \"application/json\",\n    \t\"produces\": \"application/json\",\n\t\"headers\": {},\n\t\"data\": {\n\t  \"petId\": 509194403\n\t}\n    },\n    \n    \"get:/pet/findByStatus\", \n\t{\n\t\"consumes\": \"application/json\",\n    \t\"produces\": \"application/json\",\n    \t\"headers\": {},\n\t\"data\": {\n\t  \"status\": \"sold\"\n\t}\n    },\n    \n    \"post:/pet/{petId}\",\n    {\n    \t\"consumes\": \"application/json\",\n    \t\"produces\": \"application/json\",\n\t\"headers\": {},\n\t\"data\": {\n\t  \"petId\": 509194403,\n\t  \"name\": \"Trump\",\n\t  \"status\":\"available\"\n    \t}\n    },\n    \n    \"delete:/pet/{petId}\",\n    {\n    \t\"consumes\": \"application/json\",\n    \t\"produces\": \"application/json\",\n    \t\"headers\": {\n    \t  \"api_key\":\"blah blah\"\n    \t},\n    \t\"data\": {\n    \t  \"petId\": 1964\n    \t}\n    },\n    \n    \"post:/pet\",\n    {\n    \t\"consumes\": \"application/json\",\n    \t\"produces\": \"application/json\",\n    \t\"headers\": {},\n    \t\"data\": {\n    \t  \"body\": {\n    \t    \"type\": \"dog\",\n    \t    \"name\": \"doggie\",\n    \t    \"photoUrls\": [\"http://bit.li/1\",\"http://bit.li/2\"],\n    \t    \"status\":\"sold\"\n    \t  }\n    \t}\n    }\n]\n```\n\n## Run tests\n\nIt reads the host from swagger.json, but you can override it with system property.\n\n### Using swagger file\n```mvn clean -Dswagger-file=/Users/vd-mehdi/TEMP/swagger.json -Dhost=https://petstore.swagger.io test```\n\n### Using swagger url\n```mvn clean -Dswagger-url=https://petstore.swagger.io/v2/swagger.json -Dhost=https://petstore.swagger.io test```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmehdi-reza%2Fapi-automation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmehdi-reza%2Fapi-automation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmehdi-reza%2Fapi-automation/lists"}