• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Is there anything I can do besides using Postman for multiple Ids checking

 
Ranch Hand
Posts: 1021
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi experts,

I am having problem with some of the endpoints.  The code is "obviously" correct but when I used it in another Controller, orders that were created with orderId, when I call getOrderById, it will give me correct if I entered a correct OrderId in Postman the first time, if I tried out again using another OrderId that was also created, it will give me error.

So, I just want to verify will it give me 200ok if the 2nd OrderId I entered into the Postman to check getOrderById will also be 200ok or it doesn't allow mulitple checking ?

If so, how can I check if the endpoints are working?

And then I would also like to find out if it is possible to perform a one time run job in Postman to test out all the endpoints once and I don't have to create a few Pets, then follow by a few Orders then test out the Id of Pet and Orders like that? Or am I asking something that is beyond the technolgoy?
 
Sheriff
Posts: 5555
326
IntelliJ IDE Python Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Since you're in the Spring forum I'm going to assume you're working with a Spring managed application. What you're likely looking for is Spring MockMvc and that link contains a little tutorial on how to use it.
 
tangara goh
Ranch Hand
Posts: 1021
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tim Cooke wrote:Since you're in the Spring forum I'm going to assume you're working with a Spring managed application. What you're likely looking for is Spring MockMvc and that link contains a little tutorial on how to use it.



Hi Tim,

Because I am only left with a number of days and I need to go so I'm thinking of doing it by using Java exception.  Do you think if this is plausible?



or using SLF4J.logging do you think will help  ?

 
Tim Cooke
Sheriff
Posts: 5555
326
IntelliJ IDE Python Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm going to say that is not a good idea. Any exception thrown from a controller will result in a 500 http response code with the stack trace contained in the response body, which really is spilling the guts of your application for the world to see.

If a "not found" is the response you want to express from your API then use the appropriate http status code with the returned ResponseEntity.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic