{"id":26016548,"url":"https://github.com/mick-j/unittestingweatherapi","last_synced_at":"2025-06-30T08:07:02.864Z","repository":{"id":280902391,"uuid":"943553309","full_name":"Mick-J/unitTestingWeatherAPI","owner":"Mick-J","description":"Testing Weather REST API With Wiremock","archived":false,"fork":false,"pushed_at":"2025-03-05T22:40:33.000Z","size":0,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-05T23:28:04.567Z","etag":null,"topics":["java","rest-api","testing","weather-api","wiremock"],"latest_commit_sha":null,"homepage":"","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/Mick-J.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":"2025-03-05T22:28:03.000Z","updated_at":"2025-03-05T22:43:39.000Z","dependencies_parsed_at":"2025-03-05T23:28:13.232Z","dependency_job_id":"aeb65a65-5661-4af4-91bd-5a5d32b5221f","html_url":"https://github.com/Mick-J/unitTestingWeatherAPI","commit_stats":null,"previous_names":["mick-j/unittestingweatherapi"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Mick-J/unitTestingWeatherAPI","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mick-J%2FunitTestingWeatherAPI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mick-J%2FunitTestingWeatherAPI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mick-J%2FunitTestingWeatherAPI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mick-J%2FunitTestingWeatherAPI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Mick-J","download_url":"https://codeload.github.com/Mick-J/unitTestingWeatherAPI/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mick-J%2FunitTestingWeatherAPI/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262736603,"owners_count":23356147,"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":["java","rest-api","testing","weather-api","wiremock"],"created_at":"2025-03-06T04:21:56.520Z","updated_at":"2025-06-30T08:07:02.847Z","avatar_url":"https://github.com/Mick-J.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Testing Weather REST API  With Wiremock\n\nIn this project we :\n- create a REST API on weather data source\n- test the service part of the REST API using wiremock\n\n#### 1.Weather API call\nIn the Restcontroller We fetch data from 3 endpoints:\n- /current.json  : provide weather data\n- /astronomy.json : provide weather data\n- /alerts.json  : provide alerts data\n\ncurl can be used to fetch data from endpoints:\n\n```\ncurl -X GET --location \"http://localhost:8080/current.json?city=Paris\"\ncurl -X GET --location \"http://localhost:8080/alerts.json?city=new+york\"\ncurl -X GET --location \"http://localhost:8080/astronomy.json?city=Brussels\"\n```\n\n\n\nAll API call by our REST controller were successful as shown below:\n\n\u003cimg width=\"428\" alt=\"rest_api_call\" src=\"https://github.com/user-attachments/assets/0d4039de-3457-4de9-a422-ce0300d2ba32\" /\u003e\n\n\n#### 2.Testing whith Wiremock\nFor testing we mock, GET requests in json file as well as return data to check.\nWe have tested also 404 response cases for each endpoints.\nall tests was successful as shown below:\n\n\u003cimg width=\"331\" alt=\"tests_success\" src=\"https://github.com/user-attachments/assets/b2ad8f39-c57f-4e72-9b95-4fc0f527e675\" /\u003e\n\n\n#### 3.Tech Stack\n- Java 21\n- JUnit 5 (for unit testing)\n- WireMock (for mocking external APIs)\n- Spring Boot\n- Maven(for dependency management)\n\n\n\n\n`Link Weather Service`:\n\u003ca href=\"https://www.weatherapi.com/\" title=\"Free Weather API\"\u003eWeatherAPI.com\u003c/a\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmick-j%2Funittestingweatherapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmick-j%2Funittestingweatherapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmick-j%2Funittestingweatherapi/lists"}