{"id":37027740,"url":"https://github.com/drop-project-edu/stdin-stdout-junit-helper","last_synced_at":"2026-01-14T03:18:13.202Z","repository":{"id":57742586,"uuid":"254451061","full_name":"drop-project-edu/stdin-stdout-junit-helper","owner":"drop-project-edu","description":"Helper for testing stdin/stdout interactions","archived":false,"fork":false,"pushed_at":"2024-11-04T14:13:44.000Z","size":27,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-04T15:24:14.379Z","etag":null,"topics":["java","junit","kotlin","stdin","stdout"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/drop-project-edu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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-04-09T18:40:35.000Z","updated_at":"2024-11-04T14:12:28.000Z","dependencies_parsed_at":"2024-11-04T15:35:32.254Z","dependency_job_id":null,"html_url":"https://github.com/drop-project-edu/stdin-stdout-junit-helper","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/drop-project-edu/stdin-stdout-junit-helper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drop-project-edu%2Fstdin-stdout-junit-helper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drop-project-edu%2Fstdin-stdout-junit-helper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drop-project-edu%2Fstdin-stdout-junit-helper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drop-project-edu%2Fstdin-stdout-junit-helper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/drop-project-edu","download_url":"https://codeload.github.com/drop-project-edu/stdin-stdout-junit-helper/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drop-project-edu%2Fstdin-stdout-junit-helper/sbom","scorecard":{"id":356699,"data":{"date":"2025-08-11","repo":{"name":"github.com/drop-project-edu/stdin-stdout-junit-helper","commit":"ca8777c4408e0eb397f1db9c1926a4b3c09cbf15"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.2,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Code-Review","score":1,"reason":"Found 1/10 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.txt:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE.txt:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v0.2.0 not signed: https://api.github.com/repos/drop-project-edu/stdin-stdout-junit-helper/releases/100019524","Warn: release artifact v0.2.0 does not have provenance: https://api.github.com/repos/drop-project-edu/stdin-stdout-junit-helper/releases/100019524"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":3,"reason":"branch protection is not maximal on development and all release branches","details":["Info: 'allow deletion' disabled on branch 'master'","Info: 'force pushes' disabled on branch 'master'","Info: 'branch protection settings apply to administrators' is required to merge on branch 'master'","Warn: could not determine whether codeowners review is allowed","Warn: no status checks found to merge onto branch 'master'","Warn: PRs are not required to make changes on branch 'master'; or we don't have data to detect it.If you think it might be the latter, make sure to run Scorecard with a PAT or use Repo Rules (that are always public) instead of Branch Protection settings"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 3 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-18T09:46:32.733Z","repository_id":57742586,"created_at":"2025-08-18T09:46:32.733Z","updated_at":"2025-08-18T09:46:32.733Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28408824,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T01:52:23.358Z","status":"online","status_checked_at":"2026-01-14T02:00:06.678Z","response_time":107,"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":["java","junit","kotlin","stdin","stdout"],"created_at":"2026-01-14T03:18:11.956Z","updated_at":"2026-01-14T03:18:13.194Z","avatar_url":"https://github.com/drop-project-edu.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Stdin/Stdout Helper for JUnit\n\nUseful for testing java/kotlin programs interaction with the command line. \n\n## How to install\n\nInclude the following dependency on your pom file:\n\n    \u003cdependency\u003e\n\t    \u003cgroupId\u003eorg.dropproject\u003c/groupId\u003e\n\t    \u003cartifactId\u003estdin-stdout-junit-helper\u003c/artifactId\u003e\n\t    \u003cversion\u003e0.4.1\u003c/version\u003e\n\t\u003c/dependency\u003e\n\t\n## How to use\n\n```java\npublic class Main {\n    public static void main(String args[]) {\n        Scanner scanner = new Scanner(System.in);\n        \n        System.out.print(\"Enter your name\");\n        String name = scanner.nextLine();\n        System.out.println(\"Your name is \" + name);\n        \n        scanner.close();\n    }\n}\n\n\nclass TestStdinStdout {\n\n    @Test\n    public void testAskName() {\n        StdinStdoutHelper helper = new StdinStdoutHelper()\n                .expectOutput(\"Enter your name\")\n                .simulateInput(\"Pedro\")\n                .expectOutput(\"Your name is Pedro\");\n\n        helper.start();\n        main(null);\n        helper.stop();\n    }\n}\n```\n\n### Contextual information on failure\n\nIn highly interactive programs, it can be difficult to understand what happened on certain\ntest failures. You can pass a `showDetailedErrors` and a `òutputBufferSize` to the\n`StdinStdoutHelper` constructor, as in this example:\n\n```java\nStdinStdoutHelper helper = new StdinStdoutHelper(true, 20)\n                .expectOutput(\"Enter your name\")\n                .simulateInput(\"Pedro\")\n                .expectOutput(\"Enter your age\")\n                .simulateInput(\"45\")\n                .expectOutput(\"Pedro, you're 45 years old!\");\n```                    \nThis will show the last 20 (or less) lines of the interaction before the failure.\n\n### Ignoring output lines\n\nIf the program writes several lines to the stdout that you don't want to test, you can use the function `expectNNumberOfLines`:\n```java\nStdinStdoutHelper helper = new StdinStdoutHelper()\n                .expectOutput(\"Enter the file name\")\n                .simulateInput(\"data.txt\")\n                .expectOutput(\"The data contained in the file:\")\n                .expectNNumberOfLines(57)  // suppose the file has 57 lines\n                .expectOutput(\"Read another file? [Y|N]\")\n                .simulateInput(\"N\");\n```\n\n### Dynamic behaviour\n\nSuppose you have a program that prints a random number to the stdout, and you want to test that the printed number is \nwithin a certain range. You can use the `matchOutput` which receives a predicate function. This function receives the\nline that was printed to the screen and returns true if it matches the expected value. This is evaluated during the\nprogram's execution.\n\n#### Example in Kotlin\n```kotlin\nval helper = StdinStdoutHelper()\n    .expectOutput(\"Press enter to generate a random number between 1 and 100\")\n    .simulateInput(\"\")  // press enter\n    .matchOutput { it in 1..100 }\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrop-project-edu%2Fstdin-stdout-junit-helper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrop-project-edu%2Fstdin-stdout-junit-helper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrop-project-edu%2Fstdin-stdout-junit-helper/lists"}