类 FlashAttributeResultMatchers
- java.lang.Object
- org.springframework.test.web.servlet.result.FlashAttributeResultMatchers
public class FlashAttributeResultMatchers extends Object
Factory for "output" flash attribute assertions.An instance of this class is typically accessed via
MockMvcResultMatchers.flash()
.- 从以下版本开始:
- 3.2
- 作者:
- Rossen Stoyanchev
构造器概要
构造器 限定符 构造器 说明 protected
FlashAttributeResultMatchers()
Protected constructor.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 <T> ResultMatcher
attribute(String name, Object value)
Assert a flash attribute's value.<T> ResultMatcher
attribute(String name, Matcher<T> matcher)
Assert a flash attribute's value with the given HamcrestMatcher
.<T> ResultMatcher
attributeCount(int count)
Assert the number of flash attributes.<T> ResultMatcher
attributeExists(String... names)
Assert the existence of the given flash attributes.
构造器详细资料
FlashAttributeResultMatchers
protected FlashAttributeResultMatchers()
Protected constructor. UseMockMvcResultMatchers.flash()
.
方法详细资料
attribute
public <T> ResultMatcher attribute(String name, Matcher<T> matcher)
Assert a flash attribute's value with the given HamcrestMatcher
.
attribute
public <T> ResultMatcher attribute(String name, Object value)
Assert a flash attribute's value.
attributeExists
public <T> ResultMatcher attributeExists(String... names)
Assert the existence of the given flash attributes.
attributeCount
public <T> ResultMatcher attributeCount(int count)
Assert the number of flash attributes.