自动用随机数据填充原始属性? [英] Fill primitive properties with random data automatically?

查看:92
本文介绍了自动用随机数据填充原始属性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有一个java库可以帮助创建用于测试的类实例?一个检查bean的属性并用随机数据填充它。

我基本上在寻找相当于 Object Hydrator

Is there a java library that would help with creating instances of classes for testing? One that examines the properties of a bean and fills it with random data.
I'm basically looking for Java equivalent of Object Hydrator for C#.

推荐答案

你可以使用 PoDaM

PodamFactory factory = new PodamFactoryImpl();
Pojo myPojo = factory.manufacturePojo(Pojo.class);

这篇关于自动用随机数据填充原始属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆