188189190191192193194195
/** * 取出Shiro中的当前用户LoginName. */ private String getCurrentUserName() { ShiroUser user = (ShiroUser) SecurityUtils.getSubject().getPrincipal(); return user.loginName; }
31323334353637
private BusinessLogger businessLogger; @Before public void setUp() { MockitoAnnotations.initMocks(this); ShiroTestUtils.mockSubject(new ShiroUser("foo", "Foo")); }