{"id":22358860,"url":"https://github.com/ollysun/embl-codetest-challenge","last_synced_at":"2026-04-28T10:35:44.410Z","repository":{"id":121320435,"uuid":"338779261","full_name":"ollysun/embl-codetest-challenge","owner":"ollysun","description":"This is the coding test from embl to create, read, update and delete of Person Object It is build with Spring Security Basic Authentication with unit and integration test","archived":false,"fork":false,"pushed_at":"2021-03-29T00:23:04.000Z","size":27,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-03T14:09:04.504Z","etag":null,"topics":["basic-authentication","h2-database","java-8","spring-boot","spring-security"],"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/ollysun.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":"2021-02-14T10:27:56.000Z","updated_at":"2021-03-29T00:23:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"8759ea77-5581-4e65-a1b6-a66e63d754d8","html_url":"https://github.com/ollysun/embl-codetest-challenge","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ollysun/embl-codetest-challenge","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ollysun%2Fembl-codetest-challenge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ollysun%2Fembl-codetest-challenge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ollysun%2Fembl-codetest-challenge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ollysun%2Fembl-codetest-challenge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ollysun","download_url":"https://codeload.github.com/ollysun/embl-codetest-challenge/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ollysun%2Fembl-codetest-challenge/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32377586,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-28T09:24:15.638Z","status":"ssl_error","status_checked_at":"2026-04-28T09:24:15.071Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["basic-authentication","h2-database","java-8","spring-boot","spring-security"],"created_at":"2024-12-04T15:18:08.017Z","updated_at":"2026-04-28T10:35:44.389Z","avatar_url":"https://github.com/ollysun.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# embl-codetest-challenge\n\nThis is the coding test from embl to create, read, update and delete of Person Object\nIt is build with Spring Security Basic Authentication with unit and integration test\n\n### Application Structure\n\n- Files must be located under `/src/main/java` to be picked up by Spring\n- The source code is located in\n  `src/main/java/com/emblproject/moses/`\n- The project assumes `com.emblproject.moses.EmblProjectApplication` is the Spring Boot Application.\n\n### Running the app\n\nThe project is dockerize with the dockerfile inside.\n\nFollow this process carefully\n\n1) Clone the project and type\n   \n    `mvn clean package`\n   This will generate the jar file\n   \n2) Build the dockerfile with this command\n   \n   `docker build -t moses/embl-project .`\n   \n3) Run the project with this command.  \n   `docker run -p 8080:8080 moses/embl-project`\n   \nThen you can test the project on postman or any other tools.\n\n `http://localhost:8080/persons`\n\n### Endpoints\n\n#### Security \nEvery endpoints will need to be authenticated with the basic authorization\n\n`username:moses`\n `password:mosespass`\n\nThe project has six endpoints. They are all defined in the `PersonController`:\n\n- `GET /persons or /persons?size=5` - To get all persons with default size of 3 and can increase adding the param size\n- `GET /persons/{id}` - a GET endpoint and returns a  single JSON `Person` object by ID \n- `POST /persons` - a POST endpoint that takes a JSON body of the `Person` object and returns a JSON `Persons` object saved in Databse\n\n- `PUT /persons/{id}` - a PUT endpoint that takes the parameter `id` of the object to be updated, and the JSON body of the `Person` object, \n                        and returns a JSON `Person` object\n- `DELETE /persons/{id}` - a DELETE endpoint to delete `Person` object by `id`\n- `DELETE /persons` - a DELETE endpoint to delete all `Person` object\n\n# To create person, use this payload\nlocal setup running -- http://localhost:8080/persons\n\nPOST http://localhost:8080/persons\n`{\n\"first_name\": \"John\",\n\"last_name\": \"Keynes\",\n\"favourite_colour\": \"blue\",\n\"age\": \"24\"\n}`\n\nResponse\n`{\n\"id\": 1,\n\"first_name\": \"John\",\n\"last_name\": \"Keynes\",\n\"age\": \"23\",\n\"favourite_colour\": \"red\"\n}`\n\n# To update person, use this payload\nPUT http://localhost:8080/persons/1\n`{\n\"first_name\": \"John\",\n\"last_name\": \"Key\",\n\"favourite_colour\": \"yellow\",\n\"age\": \"24\"\n}`\n\nResponse\n`{\n\"id\": 1,\n\"first_name\": \"John\",\n\"last_name\": \"Key\",\n\"age\": \"24\",\n\"favourite_colour\": \"yellow\"\n}`\n\n# To Get the list of persons\nGET http://localhost:8080/persons\n\n# To Get a single person\nGET http://localhost:8080/persons/1\n\n# To Delete single person\nDELETE http://localhost:8080/persons/id\n\n# To Delete all person\nDELETE http://localhost:8080/persons\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Follysun%2Fembl-codetest-challenge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Follysun%2Fembl-codetest-challenge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Follysun%2Fembl-codetest-challenge/lists"}