@Test public void getValuesWithMissingProvider() throws Exception { ClassPropertyReference propertyReference = new ClassPropertyReference("category", this.classReference); ComponentManager contextComponentManager = this.mocker.getInstance(ComponentManager.class, "context"); when(contextComponentManager.getInstance(ClassPropertyValuesProvider.class, "DBList")) .thenThrow(new ComponentLookupException("Component not found.")); try { this.mocker.getComponentUnderTest().getValues(propertyReference, 13, "one"); fail(); } catch (XWikiRestException expected) { assertEquals("There's no value provider registered for the [DBList] property type.", expected.getMessage()); } }
@Override public PropertyValues getValues(ClassPropertyReference propertyReference, int limit, Object... filterParameters) throws XWikiRestException { return getDedicatedProvider(getPropertyType(propertyReference)).getValues(propertyReference, limit, filterParameters); }
DefaultClassPropertyValuesProvider implements ClassPropertyValuesProvider { @Override public PropertyValues getValues(ClassPropertyReference propertyReference, int limit, Object... filterParameters) throws XWikiRestException { return getDedicatedProvider(getPropertyType(propertyReference)).getValues(propertyReference, limit, filterParameters); } }
DefaultClassPropertyValuesProvider implements ClassPropertyValuesProvider { @Override public PropertyValues getValues(ClassPropertyReference propertyReference, int limit, Object... filterParameters) throws XWikiRestException { return getDedicatedProvider(getPropertyType(propertyReference)).getValues(propertyReference, limit, filterParameters); }  }
DefaultClassPropertyValuesProvider implements ClassPropertyValuesProvider { @Override public PropertyValues getValues(ClassPropertyReference propertyReference, int limit, Object... filterParameters) throws XWikiRestException { return getDedicatedProvider(getPropertyType(propertyReference)).getValues(propertyReference, limit, filterParameters); }  @Override PropertyValues getValues(ClassPropertyReference propertyReference, int limit, Object... filterParameters); @Override PropertyValue getValue(ClassPropertyReference propertyReference, Object rawValue); }
DefaultClassPropertyValuesProvider implements ClassPropertyValuesProvider { @Override public PropertyValues getValues(ClassPropertyReference propertyReference, int limit, Object... filterParameters) throws XWikiRestException { return getDedicatedProvider(getPropertyType(propertyReference)).getValues(propertyReference, limit, filterParameters); }  @Override PropertyValues getValues(ClassPropertyReference propertyReference, int limit, Object... filterParameters); @Override PropertyValue getValue(ClassPropertyReference propertyReference, Object rawValue);  }