mardi 6 juin 2017

Spring mvc it, compare payload and header values

We have some intergation tests over @RestController with a common pattern to verify that an Xpath expression exists and that an Http header is set. But I would like to go further and verify that the XPath value is equald or contained into the header.

mvc.perform(..)
  .andExpect(xpath("Item/@id/").isIn(header("Location")))

Is it something for that or should I create my own ResultMatcher ?

Aucun commentaire:

Enregistrer un commentaire