AntiCsrfFilter extends AuthenticationFilter { @Override public boolean isEnabled() { return csrfHelper.isEnabled(); } @Inject  AntiCsrfFilter(final AntiCsrfHelper csrfHelper); @Override boolean isEnabled(); static final String NAME; }
@Test public void testIsEnabled() { when(antiCrsfHelper.isEnabled()).thenReturn(true); assertTrue(underTest.isEnabled()); when(antiCrsfHelper.isEnabled()).thenReturn(false); assertFalse(underTest.isEnabled()); }