0

I follow this to create test for testing my endpoint. Problem is that in my response I am returning current time which I dont want to test. Is there some way how to ignore some value like: ${IGNORE}

hudi
  • 15,555
  • 47
  • 142
  • 246

1 Answers1

1

The default ResponseMatchers class supplied with Spring-WS uses the PayloadDiffMatcher in order to compare the given and expected payload. The compare is done using an XMLUnit Diff. You could extend the PayloadDiffMatcher (or implement your own custom ResponseMatcher) so that it allows specifying a filter for your current time element as illustrated here.

Another option is to use the xpath() ResponseMatcher and only check parts of the returned response, ignoring the time element.

Community
  • 1
  • 1
CodeNotFound
  • 1,051
  • 2
  • 22
  • 47