mtedone / podam

PODAM - POjo DAta Mocker
https://mtedone.github.io/podam
MIT License
323 stars 750 forks source link

Unsupported features #273

Closed luckyQing closed 5 years ago

luckyQing commented 5 years ago
  1. Unsupported BigInteger、BigDecimal. etc PodamFactory factory = new PodamFactoryImpl(); BigInteger bigInteger = factory.manufacturePojoWithFullData(BigInteger.class);

  2. Nested generics are not supported. etc List<BasePageResp>

daivanov commented 5 years ago

Hi,

  1. manufacturePojoWithFullData is rather dangerous method as it tries to do it with constructor with the maximum parameters. Use manufacturePojo() instead or make custom TypeManufacturer for BigDecimal.
  2. List - there is no nested generics here. Could you please clarify what do you mean?

Thanks, Daniil

luckyQing commented 5 years ago

For example, I want to mock an object, Req<BasePageReq<App<List<String>>>>, it will show me an error.

luckyQing commented 5 years ago

I want to have the following features: `PodamFactory factory = new PodamFactoryImpl();

TypeReference typeReference = new TypeReference<Req<BasePageReq<App<List>>>>() { }; Req<BasePageReq<App<List>>> data2 = factory.manufacturePojoWithFullData(typeReference);`

luckyQing commented 5 years ago

In addition, if the value of the annotation like PodamStringValue can support one randomly from array, it feels better. For example, @PodamStringValue(value={"male", "female"})

daivanov commented 5 years ago

it will show me an error

What kind of error?

Thanks, Daniil

daivanov commented 5 years ago

Use custom TypeManufacturer instead of @PodamStringValue. People really avoid them, because it forces to add podam as dependency instead of test dependency.

luckyQing commented 5 years ago

Customizing TypeManufacturer is inconvenient. And it is more convenient to use annotations

luckyQing commented 5 years ago

It does not support this generic object, etc Req<BasePageReq<App<List>>>

daivanov commented 5 years ago

Customizing TypeManufacturer is inconvenient. And it is more convenient to use annotations

You seems to be alone with that opinion so far.

It does not support this generic object, etc Req<BasePageReq<App<List>>>

I need either code to reproduce the issue or at least Podam's log.

Thanks, Daniil

luckyQing commented 5 years ago

I have implemented the functionality I need based on your suggestions and can support multiple levels of nested generics. E.g:Req<BasePageReq<App<List<String>>>>.Thank you.

daivanov commented 5 years ago

Ok, not sure what was the problem, but it is great that you have fixed it.

Thanks, Daniil