@Test public void supportedParameters() throws Exception { // Only @ModelAttribute arguments assertTrue(processor.supportsParameter(paramNamedValidModelAttr)); assertTrue(processor.supportsParameter(paramModelAttr)); assertFalse(processor.supportsParameter(paramErrors)); assertFalse(processor.supportsParameter(paramInt)); assertFalse(processor.supportsParameter(paramNonSimpleType)); }
@Test public void supportedParametersInDefaultResolutionMode() throws Exception { processor = new ModelAttributeMethodProcessor(true); // Only non-simple types, even if not annotated assertTrue(processor.supportsParameter(paramNamedValidModelAttr)); assertTrue(processor.supportsParameter(paramErrors)); assertTrue(processor.supportsParameter(paramModelAttr)); assertTrue(processor.supportsParameter(paramNonSimpleType)); assertFalse(processor.supportsParameter(paramInt)); }
@Theory public void shouldHold(@ForAll @From(Ctor.class) P p) { assertFalse(p.box().marked()); assertTrue(p.box().contents().marked()); }
@Test public void bindExceptionNotRequired() throws Exception { assertFalse(processor.isBindExceptionRequired(null, paramNamedValidModelAttr)); }
@Test public void supportedReturnTypes() throws Exception { processor = new ModelAttributeMethodProcessor(false); assertTrue(processor.supportsReturnType(returnParamNamedModelAttr)); assertFalse(processor.supportsReturnType(returnParamNonSimpleType)); }