@Test
public void testResolvePrincipal(){

	//测试传入null的情况。
	Assert.assertNull(resolver.resolvePrincipal(null));
	
	//测试传入不支持的凭据类型的情况。
	Credential credential = Mockito.mock(Credential.class);
	Assert.assertNull(resolver.resolvePrincipal(credential));
	
	//测试传入正确的凭据对象的情况。
	String username = "admin";
	UsernamePasswordCredential usernamePasswordCredential = new UsernamePasswordCredential();
	usernamePasswordCredential.setUsername(username);
	DefaultUserPrincipal principal = (DefaultUserPrincipal)resolver.resolvePrincipal(usernamePasswordCredential);
	Assert.assertNotNull(principal);
	Assert.assertEquals(username, principal.getId());
	
	
}