Skip to content

Support multiple matchers in MockMvc Kotlin DSL #24103

Closed
@devtribe

Description

@devtribe

Affects: 5.2.1.RELEASE

I would expect that in a DSL everything in a lambda block will be executed.
But if i try to assert multiple matchers in the model block only the last one will be executed.
I didn't get any feedback about this behaviour, so i get the false impression that my code is executed, if it isn't.

Doesn't work like expected:

mockMvc.get(url)
  .andExpect {
    model {
      attribute("foo", "foo")
      attribute("bar", "bar")
    }
}

Works, but is redundant code:

mockMvc.get(url)
  .andExpect {
    model { attribute("foo", "foo") }
    model { attribute("bar", "bar") }
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions