Set<String> roles = granter.grant(principal);
Set<String> roles = granter.grant(principal);
@Test public void loginWhenUsingJaasApiProvisionThenJaasSubjectContainsUsername() throws Exception { this.spring.configLocations(xml("Jaas")).autowire(); AuthorityGranter granter = this.spring.getContext().getBean(AuthorityGranter.class); when(granter.grant(any(Principal.class))).thenReturn(new HashSet<>(Arrays.asList("USER"))); this.mvc.perform(get("/username") .with(httpBasic("user", "password"))) .andExpect(content().string("user")); }
Set<String> roles = granter.grant(principal);
Set<String> roles = granter.grant(principal);