spring-framework / org.springframework.test.web.servlet.result / FlashAttributeResultMatchers

FlashAttributeResultMatchers

open class FlashAttributeResultMatchers

Factory for "output" flash attribute assertions.

An instance of this class is typically accessed via MockMvcResultMatchers#flash.

Author
Rossen Stoyanchev

Since
3.2

Functions

attribute

open fun <T : Any> attribute(name: String, matcher: Matcher<T>): ResultMatcher

Assert a flash attribute's value with the given Hamcrest Matcher.

open fun <T : Any> attribute(name: String, value: Any): ResultMatcher

Assert a flash attribute's value.

attributeCount

open fun <T : Any> attributeCount(count: Int): ResultMatcher

Assert the number of flash attributes.

attributeExists

open fun <T : Any> attributeExists(vararg names: String): ResultMatcher

Assert the existence of the given flash attributes.