processor.getServiceProperty(pfb, ref, setter, null);
assertFalse(pfb.getCardinality().isMandatory());
}
public void testProperMultiCardinality() throws Exception {
OsgiServiceCollectionProxyFactoryBean pfb = new OsgiServiceCollectionProxyFactoryBean();
Method setter = AnnotatedBean.class.getMethod("setAnnotatedBeanTypeWithCardinality0_N",
new Class[] { List.class });
ServiceReference ref = AnnotationUtils.getAnnotation(setter, ServiceReference.class);
processor.getServiceProperty(pfb, ref, setter, null);
assertFalse(pfb.getCardinality().isMandatory());
setter = AnnotatedBean.class.getMethod("setAnnotatedBeanTypeWithCardinality1_N",
new Class[] { SortedSet.class });
ref = AnnotationUtils.getAnnotation(setter, ServiceReference.class);
pfb = new OsgiServiceCollectionProxyFactoryBean();
processor.getServiceProperty(pfb, ref, setter, null);
assertTrue(pfb.getCardinality().isMandatory());
}