コード例 #1
0
  @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));
  }
コード例 #2
0
  @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));
  }
コード例 #3
0
 @Theory
 public void shouldHold(@ForAll @From(Ctor.class) P p) {
   assertFalse(p.box().marked());
   assertTrue(p.box().contents().marked());
 }
コード例 #4
0
 @Test
 public void bindExceptionNotRequired() throws Exception {
   assertFalse(processor.isBindExceptionRequired(null, paramNamedValidModelAttr));
 }
コード例 #5
0
 @Test
 public void supportedReturnTypes() throws Exception {
   processor = new ModelAttributeMethodProcessor(false);
   assertTrue(processor.supportsReturnType(returnParamNamedModelAttr));
   assertFalse(processor.supportsReturnType(returnParamNonSimpleType));
 }