Service for get information about some github repository by repository owner and repository name
Service is powered by spring-boot framework.
Project based on maven build tool.
- Compile code
mvn clean install
- Run service
mvn spring-boot:run
Unit tests tests mapper class. Run only unit tests by command:
mvn surefire:test
E2e tests tests integration with github API. In project was created two e2e tests:
- spring tests - with uses wiremock and rest-assured
- postman tests
This tests testing github-details service API and integration with Github API.
Github API is mocked by wiremock.
Directory wiremock in test resources including wiremock mappings and example responses.
Response files contains real service response payload.
In test application settings file application.yml is set github API address to wiremock service.
For run these tests on real API should change Github API url in test application.yml to real service address.
Run only e2e tests by command:
mvn failsafe:integration-test
Project contains postman collection file github-details.postman-example-request-and-tests.json.
Postman collection contains:
- variables - in brackets is default values
- serviceUrl (localhost:8080) - should contains github-details service url address with port
- repositoryOwner (spring-projects) - should contains github repository owner name
- repositoryName (spring-framework) - should contains github repository name belonging to set owner
- example request for
github-detailsservice (ExampleRequestTemplateGithubDetailsServiceApi) - example request for Github API (ExampleRequestGithubApi)
- direcotry
testwith tests request.- these requests contains script to setting environment variable depends on test case and response assertion.
- for run all tests in this directory use
Postman Collection Runnertool.
Service expose Swagger UI page for testing. Page is available at default address: