Class 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().- Since:
- 3.2
- Author:
- Rossen Stoyanchev
Constructor Summary
Constructors Modifier Constructor Description protectedFlashAttributeResultMatchers()Protected constructor.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ResultMatcherattribute(String name, Object value)Assert a flash attribute's value.<T> ResultMatcherattribute(String name, Matcher<T> matcher)Assert a flash attribute's value with the given HamcrestMatcher.ResultMatcherattributeCount(int count)Assert the number of flash attributes.ResultMatcherattributeExists(String... names)Assert the existence of the given flash attributes.
Constructor Detail
FlashAttributeResultMatchers
protected FlashAttributeResultMatchers()
Protected constructor. UseMockMvcResultMatchers.flash().
Method Detail
attribute
public <T> ResultMatcher attribute(String name, Matcher<T> matcher)
Assert a flash attribute's value with the given HamcrestMatcher.
attribute
public ResultMatcher attribute(String name, Object value)
Assert a flash attribute's value.
attributeExists
public ResultMatcher attributeExists(String... names)
Assert the existence of the given flash attributes.
attributeCount
public ResultMatcher attributeCount(int count)
Assert the number of flash attributes.