GraphConfigurationService implements IGraphConfigurationService { @Override public Set<Class> getFilterFunctions() { return ReflectionUtil.getSubTypes(Predicate.class); } GraphConfigurationService(); static void initialise(); @Override Schema getSchema(); @Override String getDescription(); @Override Set<Class> getFilterFunctions(); @SuppressFBWarnings(value = "REC_CATCH_EXCEPTION", justification = "Need to wrap all runtime exceptions before they are given to the user") @Override Set<Class> getFilterFunctions(final String inputClass); @SuppressFBWarnings(value = "REC_CATCH_EXCEPTION", justification = "Need to wrap all runtime exceptions before they are given to the user") @Override Set<String> getSerialisedFields(final String className); @Override Set<Class> getTransformFunctions(); @Override Set<StoreTrait> getStoreTraits(); @Override Set<Class> getNextOperations(final String operationClassName); @Override Set<Class> getElementGenerators(); @Override Set<Class> getObjectGenerators(); @Override Set<Class> getOperations(); @Override Boolean isOperationSupported(final Class operation);  }
@Test public void shouldGetFilterFunctions() throws IOException { final Set<Class> classes = service.getFilterFunctions(null); assertThat(classes, IsCollectionContaining.hasItem(IsA.class)); }
@Test public void shouldGetFilterFunctionsWithInputClass() throws IOException { final Set<Class> classes = service.getFilterFunctions(Long.class.getName()); assertThat(classes, IsCollectionContaining.hasItem(IsLessThan.class)); assertThat(classes, IsCollectionContaining.hasItem(IsMoreThan.class)); assertThat(classes, IsCollectionContaining.hasItem(Not.class)); }
@Test public void shouldThrowExceptionWhenGetFilterFunctionsWithUnknownClassName() throws IOException { try { service.getFilterFunctions("an unknown class name"); fail("Exception expected"); } catch (final IllegalArgumentException e) { assertNotNull(e.getMessage()); } }