I have large number of APIs which I received in swagger json files. I want to stub these hundreds of APIs for which I require to autofill the returnable POJOs with some meaningful data( and not random data ). The aim is to mock these APIs with minimal effort. The closest thing which I found is Podam java library but it generates random data (as shown here - https://mtedone.github.io/podam/). It also generates attribute level meaningful data (in section "Defining an attribute-level strategy" on the previous link), but it mounts to same effort one would take to individually make POJOs. Can anybody prvide suggestion as to how should I solve this with minimal effort.
Asked
Active
Viewed 132 times
0
-
out of curiosity, what is the reason for meaningful test data when the API logic will be mocked anyway? – guido Jan 09 '20 at 08:39
-
@guido So that I can host the APIs to show something on dashboard meanwhile working on implementing logic – definepi314 Jan 09 '20 at 08:51
-
It's a X-Y problem. You do *not* need to generate Java POJO attributes, what you *really* need is to mock the *whole API* so it returns the responses you wish. See my answer below. – Honza Zidek Jan 09 '20 at 09:59
-
1@Honza Zidek Yeah, mocking the API will do. Mocking POJOs was just one of my approaches – definepi314 Jan 10 '20 at 07:40
-
I deleted my answer, because I found that your question is a duplicate and has already been answered here: https://stackoverflow.com/q/38344711/2886891 – Honza Zidek Jan 10 '20 at 14:13