@Test @SuppressWarnings("unchecked") public void testProvideFilters() { String arbitraryElementUUID = "arbitraryElementUUID"; Object arbitraryObject = mock(Object.class); Collection<FormElementFilter> result = filterProvider.provideFilters(arbitraryElementUUID, arbitraryObject); assertEquals(1, result.size()); FormElementFilter filter = result.iterator().next(); assertEquals("general.name", filter.getElementName()); Object arbitraryValue = mock(Object.class); assertFalse(filter.getPredicate().test(arbitraryValue)); assertEquals(DirectionalAssociation.class, filterProvider.getDefinitionType()); }
@SuppressWarnings("unchecked") @Override public Collection<FormElementFilter> provideFilters(String elementUUID, Object definition) { FormElementFilter nameFilter = new FormElementFilter("general.name", o -> false); return Collections.singletonList(nameFilter); }
AssociationFilterProvider implements StunnerFormElementFilterProvider { @SuppressWarnings("unchecked") @Override public Collection<FormElementFilter> provideFilters(String elementUUID, Object definition) { FormElementFilter nameFilter = new FormElementFilter("general.name", o -> false); return Collections.singletonList(nameFilter); } }
AssociationFilterProvider implements StunnerFormElementFilterProvider { @SuppressWarnings("unchecked") @Override public Collection<FormElementFilter> provideFilters(String elementUUID, Object definition) { FormElementFilter nameFilter = new FormElementFilter("general.name", o -> false); return Collections.singletonList(nameFilter); } AssociationFilterProvider(); }
AssociationFilterProvider implements StunnerFormElementFilterProvider { @SuppressWarnings("unchecked") @Override public Collection<FormElementFilter> provideFilters(String elementUUID, Object definition) { FormElementFilter nameFilter = new FormElementFilter("general.name", o -> false); return Collections.singletonList(nameFilter); } AssociationFilterProvider(); @Override Class<?> getDefinitionType(); @SuppressWarnings("unchecked") @Override Collection<FormElementFilter> provideFilters(String elementUUID,
                                                        Object definition); }
AssociationFilterProvider implements StunnerFormElementFilterProvider { @SuppressWarnings("unchecked") @Override public Collection<FormElementFilter> provideFilters(String elementUUID, Object definition) { FormElementFilter nameFilter = new FormElementFilter("general.name", o -> false); return Collections.singletonList(nameFilter); } AssociationFilterProvider(); @Override Class<?> getDefinitionType(); @SuppressWarnings("unchecked") @Override Collection<FormElementFilter> provideFilters(String elementUUID,
                                                        Object definition);  }