Building a mock API server for the ScholarX API

Hi all,

I went through major mock server applications including Postman and Insomnia. The problem is, those platforms have their own limitations. ex: a limited number of requests.

In my humble opinion, one of the ideal solutions would be invoking the API service directly for the developments. (Thanks @Gravewalker for the silly idea! :hugs: :grin:) There are some unimplemented APIs, shall we implement only the controllers for those APIs until they get completed?

However, I used Postman to test the available APIs. While testing them I created a collection too… Click this handy button to add it to your postman,
Run in Postman
Thanks, @piumal1999 and @YohanAvishke you have done a great job with the backend!

I’ve found the following bugs,

POST admin/programs

  • The state should not send as a parameter - because it’s always should be in the CREATED state
  • The request body isn’t validated. ex: throws 500 when a not null field is not available in the body
  • If the landing page URL or image URL is not in the body, it adds a null value for them. It should return a bad request.

PUT admin/programs/{id}/state

  • Throws 400.
Resolved [org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: 
Cannot deserialize instance of `org.sefglobal.scholarx.util.ProgramState` out of START_OBJECT token;
nested exception is com.fasterxml.jackson.databind.exc.MismatchedInputException: 
Cannot deserialize instance of `org.sefglobal.scholarx.util.ProgramState` out of START_OBJECT token

But I’m not sure if I sent the correct payload. This is what I sent: {"state": "CREATED"}

DELETE /admin/programs/{id}/state

  • Works fine, but send an empty payload as the response. It should have a body.

Other:

  • No endpoint to edit a program

(I didn’t check other admin APIs because apply as a mentee and mentor APIS aren’t available)

1 Like