[x] Inspection: report the missing parameters.context JSON property
[x] Inspection: either state or list or both are required in parameters
[x] Inspection: the context value must not be blank.
[x] Inspection: report not supported property name
[x] Inspection: report not supported property names inside list. Supported ones are addFirst and addLast.
[x] Handlebars: make sure Handlebars injection works for the context property and any other property inside state and list.
[x] Handlebars: code completion for response.body and response.headers parameters in the Handlebars helper.
Accesing a state: state helper
[x] Helper definition for the name, name reference and hashes
[x] context is mandatory
[x] the value of context must not be null or empty string
[x] either property or list must be specified
[x] default is optional
[x] property must have one of the following values: updateCount, listSize, list
deleteState
[x] Inspection: either context, contexts or contextsMatching must be specified, if list is missing.
[x] Inspection: the context value must not be blank.
[x] Inspection: if list is specified, context must be specified too.
[x] Inspection: list must contain either one of the following options (but not multiple of any combination of them): deleteFirst, deleteLast, deleteIndex, deleteWhere.
[x] Inspection: deleteWhere must contain both property and value.
[x] Handlebars: make sure Handlebars injection works for all string properties in this listener.
Match a request against a context: StateRequestMatcher
[x] Handlebars: enable Handlebars language injection in request.customMatcher.parameters.hasContext and request.customMatcher.parameters.hasProperty when the matcher name is specified as state-matcher.
Should it be enabled for values of e.g. listSizeEqualTo?
[x] Inspection: hasContext and hasNotContext must not be both specified.
Summary
There is a project called wiremock-state-extension to enhance statefulness in WireMock tests.
Tasks
recordState
parameters.context
JSON propertystate
orlist
or both are required inparameters
list
. Supported ones areaddFirst
andaddLast
.context
property and any other property insidestate
andlist
.response.body
andresponse.headers
parameters in the Handlebars helper.state
helpercontext
is mandatorycontext
must not be null or empty stringproperty
orlist
must be specifieddefault
is optionalproperty
must have one of the following values:updateCount
,listSize
,list
deleteState
context
,contexts
orcontextsMatching
must be specified, iflist
is missing.list
is specified,context
must be specified too.list
must contain either one of the following options (but not multiple of any combination of them):deleteFirst
,deleteLast
,deleteIndex
,deleteWhere
.deleteWhere
must contain bothproperty
andvalue
.StateRequestMatcher
request.customMatcher.parameters.hasContext
andrequest.customMatcher.parameters.hasProperty
when the matcher name is specified asstate-matcher
.listSizeEqualTo
?hasContext
andhasNotContext
must not be both specified.Resources