{"id":22294614,"url":"https://github.com/nricheton/tdm","last_synced_at":"2025-10-05T23:29:45.811Z","repository":{"id":17498488,"uuid":"65368923","full_name":"nricheton/tdm","owner":"nricheton","description":"Test data injection framework","archived":false,"fork":false,"pushed_at":"2024-01-22T17:18:37.000Z","size":52,"stargazers_count":0,"open_issues_count":5,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-25T22:21:33.364Z","etag":null,"topics":["dataset","testing","unit-testing"],"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/nricheton.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":"2016-08-10T09:22:53.000Z","updated_at":"2021-12-12T13:05:15.000Z","dependencies_parsed_at":"2025-01-30T19:44:53.921Z","dependency_job_id":null,"html_url":"https://github.com/nricheton/tdm","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nricheton/tdm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nricheton%2Ftdm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nricheton%2Ftdm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nricheton%2Ftdm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nricheton%2Ftdm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nricheton","download_url":"https://codeload.github.com/nricheton/tdm/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nricheton%2Ftdm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278534174,"owners_count":26002705,"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","status":"online","status_checked_at":"2025-10-05T02:00:06.059Z","response_time":54,"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":["dataset","testing","unit-testing"],"created_at":"2024-12-03T17:37:51.291Z","updated_at":"2025-10-05T23:29:45.765Z","avatar_url":"https://github.com/nricheton.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tdm - Test Data Manager\n\n[![Build Status: Linux](https://travis-ci.org/nricheton/tdm.svg?branch=master)](https://travis-ci.org/nricheton/tdm)\n\nFor tests like this : \n\n\t/**\n\t * Basic usage, no data customization.\n\t * \n\t * @throws IOException\n\t */\n\t@Test\n\tpublic void test1() throws IOException {\n    \t\t// Create a customer, doesn't matter\n\t\tTestData dataId = tdm.create().with(\"customer\").perform();\n\n   \t\t // Test ensure a a customer exists in the application, with data (customer service)\n\t\tAssert.assertNotNull(cServ.get(dataId.id(\"customer\")));\n\t\tAssert.assertTrue(cServ.get(dataId.id(\"customer\")).getFirstName().length() \u003e 0);\n\t\tAssert.assertTrue(cServ.get(dataId.id(\"customer\")).getLastName().length() \u003e 0);\n\t}\n\n\t@Test\n\tpublic void test2() throws IOException {\n  \t\t  // Create a customer, any data but ensure firstName is Mike, this is important for the following test\n\t\tTestData dataId = tdm.create().with(\"customer\", map(\"firstName\", \"Mike\")).perform();\n\n\t\t    // Test has a condition triggered by the firstName. Here we just check the value. \n\t\tAssert.assertEquals(\"Mike\", cServ.get(dataId.id(\"customer\")).getFirstName());\n\t}\n \n  \nData are based on logical objects, not technical implementation, expressed by json or project specific language (plug your data provider).\n  \n\n\t{  \n\t\t\"firstName\" : \"John\",\n\t\t\"lastName\" : \"Doe\",\n\t\t\"enabled\" : true,  \n\t\t\"password\" : \"password\", \n\t\t\"groups\" : [ \"user\" ]\n\t}\n\t\n\nDaja injection is up to you : plug your own code to call classes, remote soap/rest services, browser GUI to create each type of object. \n\n\tpublic class OrderUnitTestFactory implements DataFactory {\n\n\t\tOrderService orderService;\n\n\t\tpublic void setOrderService(OrderService orderService) {\n\t\t\tthis.orderService = orderService;\n\t\t}\n\n\t\tpublic List\u003cString\u003e getTypes() {\n\t\t\treturn asList(new String[] { \"order\" });\n\t\t}\n\n\t\tpublic void create(TestData data, String type, Map\u003cString, Object\u003e values) throws IOException {\n\t\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"YYY-MM-DD\");\n\t\t\tOrder c;\n\t\t\ttry {\n\t\t\t\tc = orderService.create((String) values.get(\"customer\"), (String) values.get(\"product\"),\n\t\t\t\t\t\t((Integer) values.get(\"count\")).intValue(), sdf.parse((String) \tvalues.get(\"dateOfPurchase\")));\n\t\t\t} catch (ParseException e) {\n\t\t\t\tthrow new IOException(e);\n\t\t\t}\n\n\t\t\tdata.add(type, String.valueOf(c.getId()));\n\t\t}\n\n\t}\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnricheton%2Ftdm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnricheton%2Ftdm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnricheton%2Ftdm/lists"}