{"id":14985679,"url":"https://github.com/wasiqb/coteafs-datasource","last_synced_at":"2025-06-30T19:02:59.222Z","repository":{"id":40281790,"uuid":"289177153","full_name":"WasiqB/coteafs-datasource","owner":"WasiqB","description":":ledger: Simple Data file to object parser supports JSON, YML, XML and properties file format.","archived":false,"fork":false,"pushed_at":"2023-07-24T01:51:53.000Z","size":132,"stargazers_count":12,"open_issues_count":3,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-30T19:01:52.341Z","etag":null,"topics":["hacktoberfest","json","parser","pojo","properties","test-automation","test-data","xml","yaml","yml"],"latest_commit_sha":null,"homepage":"https://wasiqb.github.io","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/WasiqB.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"patreon":"wasiqb"}},"created_at":"2020-08-21T04:28:57.000Z","updated_at":"2023-11-10T05:14:58.000Z","dependencies_parsed_at":"2024-09-25T00:32:41.342Z","dependency_job_id":null,"html_url":"https://github.com/WasiqB/coteafs-datasource","commit_stats":{"total_commits":32,"total_committers":2,"mean_commits":16.0,"dds":0.09375,"last_synced_commit":"228299bcd783b07a2ea6721bf5c59de5370765a9"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/WasiqB/coteafs-datasource","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WasiqB%2Fcoteafs-datasource","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WasiqB%2Fcoteafs-datasource/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WasiqB%2Fcoteafs-datasource/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WasiqB%2Fcoteafs-datasource/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WasiqB","download_url":"https://codeload.github.com/WasiqB/coteafs-datasource/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WasiqB%2Fcoteafs-datasource/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262834653,"owners_count":23371845,"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":["hacktoberfest","json","parser","pojo","properties","test-automation","test-data","xml","yaml","yml"],"created_at":"2024-09-24T14:11:28.497Z","updated_at":"2025-06-30T19:02:59.164Z","avatar_url":"https://github.com/WasiqB.png","language":"Java","funding_links":["https://patreon.com/wasiqb"],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"#\"\u003e\n    \u003cimg src=\"assets/coteafs-datasource-logo.jpg\" width=300 padding=10 /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n[![Open Source Love](https://badges.frapsoft.com/os/v1/open-source.svg?v=103)][home]\n[![Test](https://github.com/WasiqB/coteafs-datasource/actions/workflows/test.yml/badge.svg?branch=master)][actions]\n\n\u003c!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section --\u003e\n\u003ca aria-label=\"All Contributors\" href=\"#contributors-\"\u003e\u003cimg alt=\"\" src=\"https://img.shields.io/badge/all_contributors-2-17BB8A.svg?style=for-the-badge\u0026labelColor=000000\"\u003e\u003c/a\u003e\n\u003c!-- ALL-CONTRIBUTORS-BADGE:END --\u003e\n\n[![Maven Central](https://img.shields.io/maven-central/v/com.github.wasiqb.coteafs/datasource.svg?style=for-the-badge)][maven]\n[![Github Releases](https://img.shields.io/github/downloads/WasiqB/coteafs-datasource/total.svg?style=for-the-badge)][release]\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg?style=for-the-badge)][license]\n\n## Usage :running:\n\n### Dependency\n\n```xml\n\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.github.wasiqb.coteafs\u003c/groupId\u003e\n    \u003cartifactId\u003edatasource\u003c/artifactId\u003e\n    \u003cversion\u003e1.2.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n### Example\n\n#### Pojo Classes\n\nPojo class for our data file `login-data.yml`.\n\n```java\nimport java.util.List;\n\nimport com.github.wasiqb.coteafs.datasource.annotation.DataFile;\nimport lombok.Data;\n\n@Data\n@DataFile\npublic class LoginData {\n    private List\u003cLogin\u003e loginData;\n}\n\n@Data\npublic class Login {\n    private String password;\n    private String userName;\n    private String path;\n}\n```\n\n#### Data file content\n\nData for our Yml data file `login-data.yml`.\n\n```yml\nlogin_data:\n  - user_name: WasiqB\n    password: Admin\n    path: ${sys:user.dir}\n  - user_name: FaisalK\n    password: Abcd\n    path: ${sys:user.dir}\n```\n\n#### Parsing data file\n\nFollowing is an example to convert data file into a TestNG data provider.\n\n```java\nimport static com.google.common.truth.Truth.assertWithMessage;\nimport static java.lang.System.getProperty;\n\nimport com.github.wasiqb.coteafs.datasource.data.LoginData;\nimport org.testng.annotations.DataProvider;\nimport org.testng.annotations.Test;\n\npublic class DataSourceYmlTest {\n    @DataProvider\n    public Iterator\u003cObject[]\u003e getLoginDataYml () {\n        final LoginData loginData = DataSource.parse (LoginData.class);\n        final List\u003cObject[]\u003e data = new ArrayList\u003c\u003e ();\n        loginData.getLoginData ()\n            .forEach (d -\u003e data.add (new Object[] { d }));\n        return data.iterator ();\n    }\n\n    @Test (dataProvider = \"getLoginDataYml\")\n    public void testYmlDataSource (final Login login) {\n        assertWithMessage (\"User Name\").that (login.getUserName ())\n            .isNotEmpty ();\n        assertWithMessage (\"Password\").that (login.getPassword ())\n            .isNotEmpty ();\n        assertWithMessage (\"Path\").that (login.getPath ())\n            .isEqualTo (getProperty (\"user.dir\"));\n    }\n}\n```\n\n#### Parsing placeholders in file field values\n\nYou can use placeholders in JSON and YML files. Following is the table of allowed variable formats which can be used in\nthe placeholder.\n\nDesired value | Sample Placeholder\n------------|------------\nBase64 Decoder | `${base64Decoder:SGVsbG9Xb3JsZCE=}`\nBase64 Encoder | `${base64Encoder:HelloWorld!}`\nJava Constant | `${const:java.awt.event.KeyEvent.VK_ESCAPE}`\nDate | `${date:yyyy-MM-dd}`\nDNS | \u003ccode\u003e${dns:address\u0026#124;apache.org}\u003c/code\u003e\nEnvironment Variable | `${env:USERNAME}`\nFile Content | `${file:UTF-8:src/test/resources/document.properties}`\nJava | `${java:version}`\nLocalhost | `${localhost:canonical-name}`\nProperties File | `${properties:src/test/resources/document.properties::mykey}`\nResource Bundle | `${resourceBundle:org.example.testResourceBundleLookup:mykey}`\nScript | `${script:javascript:3 + 4}`\nSystem Property | `${sys:user.dir}`\nURL Decoder | `${urlDecoder:Hello%20World%21}`\nURL Encoder | `${urlEncoder:Hello World!}`\nURL Content (HTTP) | `${url:UTF-8:http://www.apache.org}`\nURL Content (HTTPS) | `${url:UTF-8:https://www.apache.org}`\nURL Content (File) | `${url:UTF-8:file:///${sys:user.dir}/src/test/resources/document.properties}`\nXML XPath | `${xml:src/test/resources/document.xml:/root/path/to/node}`\n\n\u003e Custom value is not supported in the placeholder.\n\n## Contributors ✨\n\nThanks to these wonderful people ([emoji key][emojis]):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://wasiqb.github.io\"\u003e\u003cimg src=\"https://avatars3.githubusercontent.com/u/9130909?v=4\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eWasiq Bhamla\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/WasiqB/coteafs-datasource/commits?author=WasiqB\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/WasiqB/coteafs-datasource/commits?author=WasiqB\" title=\"Tests\"\u003e⚠️\u003c/a\u003e \u003ca href=\"#infra-WasiqB\" title=\"Infrastructure (Hosting, Build-Tools, etc)\"\u003e🚇\u003c/a\u003e \u003ca href=\"https://github.com/WasiqB/coteafs-datasource/commits?author=WasiqB\" title=\"Documentation\"\u003e📖\u003c/a\u003e \u003ca href=\"#ideas-WasiqB\" title=\"Ideas, Planning, \u0026 Feedback\"\u003e🤔\u003c/a\u003e \u003ca href=\"#maintenance-WasiqB\" title=\"Maintenance\"\u003e🚧\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://mfaisalkhatri.github.io\"\u003e\u003cimg src=\"https://avatars3.githubusercontent.com/u/18361917?v=4\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eMohammad Faisal Khatri\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/WasiqB/coteafs-datasource/commits?author=mfaisalkhatri\" title=\"Tests\"\u003e⚠️\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-enable --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors][contributors] specification. Contributions of any kind welcome!\n\n[emojis]: https://allcontributors.org/docs/en/emoji-key\n[contributors]: https://github.com/all-contributors/all-contributors\n[home]: https://github.com/wasiqb/coteafs-config\n[actions]: https://github.com/WasiqB/coteafs-datasource/actions/workflows/test.yml\n[coverage]: https://sonarcloud.io/component_measures?id=com.github.wasiqb.coteafs%3Adatasource\u0026metric=Coverage\n[maven]: https://maven-badges.herokuapp.com/maven-central/com.github.wasiqb.coteafs/datasource\n[release]: https://github.com/WasiqB/coteafs-datasource/releases\n[license]: https://opensource.org/licenses/Apache-2.0","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwasiqb%2Fcoteafs-datasource","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwasiqb%2Fcoteafs-datasource","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwasiqb%2Fcoteafs-datasource/lists"}