{"id":19096021,"url":"https://github.com/criogenox/junit5-testing-by-solving-foobar-challenges","last_synced_at":"2026-05-09T05:07:00.739Z","repository":{"id":199766111,"uuid":"700790416","full_name":"criogenox/Junit5-Testing-by-Solving-Foobar-Challenges","owner":"criogenox","description":"JUnit5 annotations \u0026 methods applied to solved foobar tasks.","archived":false,"fork":false,"pushed_at":"2025-07-15T22:53:11.000Z","size":235,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-16T22:07:44.357Z","etag":null,"topics":["foobar-challenge","intellij-idea","java","junit5-framework","junit5-tests","maven"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/criogenox.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":"2023-10-05T09:50:54.000Z","updated_at":"2025-07-15T22:53:14.000Z","dependencies_parsed_at":"2024-11-09T03:46:03.015Z","dependency_job_id":null,"html_url":"https://github.com/criogenox/Junit5-Testing-by-Solving-Foobar-Challenges","commit_stats":null,"previous_names":["criogenox/junit5-testing-by-solving-foobar-challenges"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/criogenox/Junit5-Testing-by-Solving-Foobar-Challenges","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/criogenox%2FJunit5-Testing-by-Solving-Foobar-Challenges","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/criogenox%2FJunit5-Testing-by-Solving-Foobar-Challenges/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/criogenox%2FJunit5-Testing-by-Solving-Foobar-Challenges/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/criogenox%2FJunit5-Testing-by-Solving-Foobar-Challenges/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/criogenox","download_url":"https://codeload.github.com/criogenox/Junit5-Testing-by-Solving-Foobar-Challenges/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/criogenox%2FJunit5-Testing-by-Solving-Foobar-Challenges/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32807862,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"online","status_checked_at":"2026-05-09T02:00:06.633Z","response_time":123,"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":["foobar-challenge","intellij-idea","java","junit5-framework","junit5-tests","maven"],"created_at":"2024-11-09T03:35:38.207Z","updated_at":"2026-05-09T05:07:00.726Z","avatar_url":"https://github.com/criogenox.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![LinkedIn][linkedin-shield]][linkedin-url]\n\n\u003c!-- PROJECT LOGO --\u003e\n\u003cdiv align=\"center\"\u003e\n  \u003ca align=\"center\"\u003e\n    \u003cimg src=\"https://user-images.githubusercontent.com/53323058/273491246-3129bbb6-670a-49dc-a43c-87937bca67a2.png\" alt=\"Logo\" width=\"450\"\u003e\n  \u003c/a\u003e\n  \u003ch3 align=\"center\"\u003eJunit5 usage applied to solved Foobar functions\u003c/h3\u003e\n  \u003cp align=\"center\"\u003e\n     (a straightforward personal attempt)\n  \u003c/p\u003e\n\u003c/div\u003e\n\n\u003c!-- ABOUT THE REPO --\u003e\n## About the repo\n\n\u003cdiv align=\"justify\"\u003e\nThe initial aim was solving tasks on my own just for the enjoyment itself (got the invitation, anyway); however, it all turned into a fun opportunity to play around with JUnit test framework. All coding job was made in one-shot way, with a deadline and considering possible time-out errors. Of course, JUnit tests were implemented in a subsequent stage. Thus, if you came here already knowing what Foobar \u0026 JUnit are, skip the next section; if it's not the case, keep reading please :raised_hands:.\n  \n### Foobar challenge\n\n  Let's use a ChatGPT shortcut for this explantion step: \n  \n\u003e **_Google's Foobar challenge is an invitation-only coding challenge that Google uses to identify and recruit talented programmers_** (being honest, they probably could offer a sort of internship if you're talent enough; not bad at all, anyway :muscle:)\n\n\u003e **_It typically appears as a pop-up message on a user's screen when they are searching for coding-related terms on Google_** (like a creepy surprise; I thought I was being hacked)\n\n\u003e **_Some people have reported receiving an invitation after searching for specific coding-related terms on Google; or have received an invitation through a referral_** (or looking for how to remove stain from carpet; whichever occurs first)\n\n### Junit5 framework\n\n\u003e JUnit 5 is a popular open-source testing framework for Java applications. JUnit 5 provides several enhancements and new features making it more powerful and flexible for writing and executing tests.\n\n\u003e Brief description of key features used in the current repo:\n\n* **Assertions API:** offering a wide range of assertion methods for validating results.\n* **Parameterized Tests:** allowing to write repeated testing with different sets of test data.\n* **Conditional Test Execution:** concept of conditional test execution based on custom or predefined conditions.\n* **Test Instance Lifecycle:** giving more control over resource management and test isolation.\n* **Test Execution Order:** letting to define custom test execution orders by needs.\n* **Nested Tests:** permitting to group related tests within a same test class, structuring methods in a hierarchical manner.\n* **Tagging and Filtering:** enabling the capability of selectively execution based on categorizing.\n\n\u003c/div\u003e\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n### Built with\n \u003cdiv style=\"display: flex; flex-direction: row; align=center\"\u003e\n    \u003cimg src=\"https://user-images.githubusercontent.com/53323058/273763700-87da1703-8aaa-473a-82a7-595478683383.png\" alt=\"Logo\" width=\"160\" height=\"65\"/\u003e\n    \u003cimg src=\"https://user-images.githubusercontent.com/53323058/273760886-5dd75127-437e-478e-9cae-3d28e3d89149.png\" alt=\"Logo\" width=\"160\" height=\"65\"/\u003e\n    \u003cimg src=\"https://user-images.githubusercontent.com/53323058/230741096-33c1b8ab-1ec8-4364-b877-09aaa7df0fcd.png\" alt=\"Logo\" width=\"160\" height=\"65\"/\u003e\n    \u003cimg src=\"https://user-images.githubusercontent.com/53323058/273762946-9cd1d557-5ac2-4dd4-898f-9e0e369ecd72.png\" alt=\"Logo\" width=\"160\" height=\"65\"/\u003e\n\u003c/div\u003e\n \n### Additional info\n\n* Where possible, It has been done with plain readable java; no streams used (clean code, I mean).\n* Each task constructor was renamed using suffixes (ex: solution1, solution2 and so forth) to include them in a single class.\n* Added more test cases (besides those originally given), including extreme ones to avoid long execution times.\n* For a more in-depth understanding of the implemented code, as many comments as possible have been included.\n* No intention of winning the code-of-the-year championship; readability was weighted over micro-optimization.\n \n\u003c/div\u003e\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\u003c!-- SUMMARY --\u003e\n## Implementation details \n\n### Selected foobar challanges\n\u003cdiv align=\"justify\"\u003e\n\n|  Test  |           Challenge name            |       Input data type        | Output data type | Testing Status |\n|:------:|:-----------------------------------:|:----------------------------:|:-----------------:|:-------------:|\n|   1    |         `Square Supplies`           |              int             |        int        |       ✔       |\n|   2    |        `Zombit Monitoring`          |           int[ ][ ]          |        int        |       ✔       |\n|   3    |            `Palindrome`             |              int             |        int        |       ✔       |\n|   4    |         `Zombit Antidote`           |           int[ ][ ]          |        int        |       ✔       |\n|   5    |  `Please Pass The Coded Messages`   |            int[ ]            |      String       |       ✔       |\n|   6    |              `Re-ID`                |              int             |      String       |       ✔       |\n|   7    |         `Zombit Infection`          |   int[ ][ ], int, int, int   |     int[ ][ ]     |       ✔       |\n\u003c/div\u003e\n\n### Junit5 version \n\u003cdiv align=\"justify\"\u003e\n  \n\u003e **Used annotations**\n* `@Nested` (allowing to test several outer classes (challenges), actually inside the same main test class).\n* `@ParameterizedTest` (addressing the run of same test passing several groups of parameters).\n* `@CsvSource` (arguments source, as strings \u0026/or ints).\n* `@ValueSource` (arguments source, as strings or ints).\n* `@MethodSource` (arguments source, as multidimensional arrays of ints).\n* `@TestInstance` (PER_CLASS; enabling one single instance of the test class reusable for all method).\n* `@Order` (just for the sake of completeness, highly discouraged; switching the timeout test execution for the last).\n* `@DisplayName` (on classes \u0026 methods; see left figure).\n* `@EnabledIf` (allowing to skip a test if a true condition is not satisfied; see right figure).\n* `@BeforeEach` (displaying on screen the timestamp \u0026 test info; see bottom figure).\n* `@Tag` (identifies each test class for display info purposes).\n\n\u003e **Implemented utility methods**\n* `assertEquals` (checking against expected; input as int || String).\n* `assertArrayEquals` (checking against expected; input as multidimensional arrays, int[ ][ ]).\n* `assertTimeout` (seeking for timeout errors).\n* `assertTrue` (rejecting null \u0026 strings, including empty values).\n* `arguments.of(Object ...)` (input source; as multidimensional arrays of ints or strings).\n\n### Screenshots of tests runs results\n\n\u003cp align=\"center\" width=\"100%\"\u003e\n    \u003cimg width=\"45%\" src=\"https://user-images.githubusercontent.com/53323058/274168459-a64662af-d4c9-486d-a80f-f41475621f02.png\"\u003e\n    \u003cimg width=\"46.4%\" src=\"https://user-images.githubusercontent.com/53323058/274165423-e0a6d50a-e1da-4e8c-baf5-48afceaf0d06.png\"\u003e\n\u003c/p\u003e\n  \u003cp align=\"center\" width=\"100%\"\u003e\n    \u003cimg width=\"92%\" src=\"https://user-images.githubusercontent.com/53323058/274107022-c3129d5e-f51d-4b1c-8e23-f9f64099e973.png\"\u003e\n\u003c/p\u003e\n        \n\u003c/div\u003e\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\u003c!-- LICENSE --\u003e\n## License\n\nDistributed under the MIT License. See `LICENSE.txt` for more information.\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\u003c!-- MARKDOWN LINKS \u0026 IMAGES --\u003e\n\u003c!-- https://www.markdownguide.org/basic-syntax/#reference-style-links --\u003e\n[linkedin-shield]: https://user-images.githubusercontent.com/53323058/230575198-fa1acbf4-8f82-4d8e-b245-3979276bc240.png\n[linkedin-url]: https://linkedin.com/in/criogenox/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcriogenox%2Fjunit5-testing-by-solving-foobar-challenges","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcriogenox%2Fjunit5-testing-by-solving-foobar-challenges","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcriogenox%2Fjunit5-testing-by-solving-foobar-challenges/lists"}