Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to create dummy data for unit test?

I need to insert dummy data on test environtment so that I can run unit test on it but I don't know how to declare it on BootStrap (just for testing, not for all environtment)

can you help me ? thank you in advance

like image 655
nightingale2k1 Avatar asked Mar 01 '23 09:03

nightingale2k1


1 Answers

as noted, you can use the test fixture. you can also put code in bootstrap. if you are using junit 4, you might be able to use @BeforeClass. also, there is the build-test-data plugin that may be of interest.

if you really mean unit test (as opposed to integration test), take a look at the grails testing plugin (these run fast).

like image 130
Ray Tayek Avatar answered Mar 07 '23 15:03

Ray Tayek