@@ -102,17 +102,18 @@ The file should contain 1000 lines.
102102MockNeat m = MockNeat . threadLocal();
103103final Path path = Paths . get(" ./test.csv" );
104104
105- m. fmt(" #{id},#{first},#{last},#{email},#{salary}" )
106- .param(" id" , m. longSeq()) // Replaces #{id} with a long number in a sequence
107- .param(" first" , m. names(). first()) // Replaces #{first} with a first name
108- .param(" last" , m. names(). last()) // Replaces #{last} with a last name
109- .param(" email" , m. emails()) // Replaces #{email} with an arbitrary email
110- .param(" salary" , m. money(). locale(GERMANY ). range(2000 , 5000 )) // Replace #{salary} with a sum of money (EUR) in the given range
111- .list(1000 ) // Generates a list of 1000 Strings
112- .consume(list - > {
113- try { Files . write(path, list, CREATE , WRITE ); }
114- catch (IOException e) { e. printStackTrace(); }
115- }); // Writes the list to a file
105+ m. fmt(" #{id},#{first},#{last},#{email},#{salary},#{creditCardNum}" )
106+ .param(" id" , m. longSeq(). start(10 ). increment(10 ). mapToString(). escapeCsv())
107+ .param(" first" , m. names(). first(). escapeCsv())
108+ .param(" last" , m. names(). last(). escapeCsv())
109+ .param(" email" , m. emails(). domain(" company.com" ). mapToString(). escapeCsv())
110+ .param(" salary" , m. ints(). range(1000 , 5000 ). mapToString(). escapeCsv())
111+ .param(" creditCardNum" , m. creditCards(). type(AMERICAN_EXPRESS ). escapeCsv())
112+ .list(1000 )
113+ .consume(list - > {
114+ try { Files . write(path, list, CREATE , WRITE ); }
115+ catch (IOException e) { e. printStackTrace(); }
116+ });
116117```
117118
118119Possible Output:
0 commit comments