}
@Test
public void methodWithConstrainedParameter() throws Exception {
Method method = CustomerRepositoryExt.class.getMethod( "createCustomer", CharSequence.class, String.class );
ExecutableMetaData methodMetaData = beanMetaData.getMetaDataFor(
ExecutableElement.forMethod(
method
)
);
assertFalse( methodMetaData.isCascading() );
assertTrue( methodMetaData.isConstrained() );
assertThat( methodMetaData ).isEmpty();
assertFalse( methodMetaData.getParameterMetaData( 0 ).isConstrained() );
assertFalse( methodMetaData.getParameterMetaData( 0 ).isCascading() );
assertTrue( methodMetaData.getParameterMetaData( 1 ).isConstrained() );
assertFalse( methodMetaData.getParameterMetaData( 1 ).isCascading() );
assertThat( methodMetaData.getParameterMetaData( 1 ) ).hasSize( 1 );
assertEquals(
methodMetaData.getParameterMetaData( 1 )
.iterator()
.next()
.getDescriptor()
.getAnnotation()
.annotationType(),
NotNull.class
);
assertThat( methodMetaData ).isEmpty();
assertThat( methodMetaData.getCrossParameterConstraints() ).isEmpty();
}