Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

223
Views
Coincidencia de solicitud de Wiremock con fecha dinámica: ¿cómo verificar una fecha en la prueba?

Necesito verificar en mi prueba que la fecha solicitada es exactamente hoy. ¿Cómo puedo hacer esto? Intenté diferentes formas del Doc, pero no obtuve el resultado deseado. Ayuda por favor un pobre junior qa :)

De qué manera lo intenté (mi colega me aconsejó este, y se ve bastante bien, considere la documentación)

 { "request": { "urlPath": "/test/calc", "method": "POST", "headers": { "Accept": { "equalTo": "application/json" }, "Content-Type": { "equalTo": "application/json" } }, "bodyPatterns": [ { "matchesJsonPath": { "expression": "$.addDate", "and": [ { "before": "now + 1 days" }, { "after": "now - 1 days" } ] }, "equalToJson": { "RequestBody": { "order": { "positionList": [ { "id": 1, "addDate": "${json-unit.any-string}", "qty": 1 } ] } } }, "ignoreArrayOrder": false } ] }, "response": { "transformers": [ "response-template" ], "status": 200, "bodyFileName": "v1/test-service-mock-response.json", "headers": { "Content-Type": "application/json" } } }

Necesito verificar el parámetro "addDate" en la solicitud. El formato de fecha es = "addDate": "2022-03-31".

*También probé esta variante "addDate": "{{now format='yyyy-MM-dd'}}". No funcionó tan bien. Wiremock no cumplió con tales solicitudes.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!