List of usage examples for org.springframework.security.access ConfigAttribute ConfigAttribute
ConfigAttribute
From source file:be.dnsbelgium.rate.spring.security.LeakyBucketVoterTest.java
@Test @SuppressWarnings("unchecked") public void testSupportsConfigAttribute() { final LeakyBucketVoter voter = new LeakyBucketVoter(mock(LeakyBucketService.class), keyFactory, DEFAULT_AMOUNT);// w w w . j a v a 2s . com assertEquals(true, voter.supports(new SecurityConfig(LeakyBucketVoter.PREFIX + "ANY_SUFFIX"))); assertEquals(false, voter.supports(new SecurityConfig("NOT" + LeakyBucketVoter.PREFIX + "ANY_SUFFIX"))); assertEquals(false, voter.supports(new ConfigAttribute() { @Override public String getAttribute() { return null; } })); }