FilterProviderImpl implements FilterProvider { @Activate protected void activate(Configuration configuration, Map<String, Object> properties) { setPath(configuration); }  @Override boolean handlesPath(@NotNull String oakPath); @NotNull @Override String getFilterRoot(); @NotNull @Override Filter getFilter(@NotNull SecurityProvider securityProvider, @NotNull Root root, @NotNull NamePathMapper namePathMapper);  }
@Test public void testActivate() { FilterProviderImpl fp = new FilterProviderImpl(); assertNull(fp.getFilterRoot()); fp.activate(when(mock(FilterProviderImpl.Configuration.class).path()).thenReturn(PATH).getMock(), Collections.emptyMap()); assertEquals(PATH, fp.getFilterRoot()); }
@Test(expected = IllegalStateException.class) public void testActivateEmptyPath() { FilterProviderImpl fp = new FilterProviderImpl(); fp.activate(when(mock(FilterProviderImpl.Configuration.class).path()).thenReturn("").getMock(), Collections.emptyMap()); }
@Test(expected = IllegalStateException.class) public void testActivateNullPath() { FilterProviderImpl fp = new FilterProviderImpl(); fp.activate(when(mock(FilterProviderImpl.Configuration.class).path()).thenReturn(null).getMock(), Collections.emptyMap()); }
@Test(expected = IllegalStateException.class) public void testActivateRelativePath() { FilterProviderImpl fp = new FilterProviderImpl(); fp.activate(when(mock(FilterProviderImpl.Configuration.class).path()).thenReturn("rel/path").getMock(), Collections.emptyMap()); }