java - Rest Assured - retry request if failed -


example test:

@test public void shouldgetrouteslist() {     response response =             given()                     .headers("requestid", 10)                     .headers("authorization", accesstoken)                     .contenttype(contenttype.json).             expect()                     .statuscode(httpurlconnection.http_ok).             when()                     .get("address");     string responsebody = response.getbody().asstring();     system.out.println(responsebody);     logger.info("log message"); } 

thing response service equals 500 error. it's because of application error , it's application fault add temp. workaround retry .get if service returns 500. thinking if or do-while know it's not clever way. advice solution ?

in words - want retry whole test (or .get) if statuscode=!http_ok


Comments

Popular posts from this blog

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

python - How do I create a list index that loops through integers in another list -

c# - “System.Security.Cryptography.CryptographicException: Keyset does not exist” when reading private key from remote machine -