test_class.declarator: resolver = new UsernamePasswordCredentialToPrincipalResolver()
test_class.modifier: private
test_class.original_string: private UsernamePasswordCredentialToPrincipalResolver resolver = new UsernamePasswordCredentialToPrincipalResolver();
test_class.type: UsernamePasswordCredentialToPrincipalResolver
test_class.var_name: resolver
test_class.file: ki4so-core/src/test/java/com/github/ebnew/ki4so/core/authentication/resolvers/UsernamePasswordCredentialToPrincipalResolverTest.java
test_class.identifier: UsernamePasswordCredentialToPrincipalResolverTest
test_case.body: @Test
  	public void testSupports(){
  		//测试凭据为空的情况。
  		Assert.assertFalse(resolver.supports(null));
  		
  		//测试不支持的凭据类型的情况。
  		Credential credential = Mockito.mock(Credential.class);
  		Assert.assertFalse(resolver.supports(credential));
  		
  		//测试支持的凭据类型UsernamePasswordCredential的情况。
  		credential = new UsernamePasswordCredential();
  		Assert.assertTrue(resolver.supports(credential));
  		
  		
  		//测试支持的凭据类型UsernamePasswordCredential的子类情况。
  		credential = new SubUsernamePasswordCredential();
  		Assert.assertTrue(resolver.supports(credential));
  	}
test_case.class_method_signature: UsernamePasswordCredentialToPrincipalResolverTest.testSupports()
test_case.full_signature: @Test public void testSupports()
test_case.identifier: testSupports
test_case.invocations: assertFalse supports mock assertFalse supports assertTrue supports assertTrue supports
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testSupports()
focal_class.declarator: DEFAULT_CLASS = UsernamePasswordCredential.class
focal_class.modifier: private static final
focal_class.original_string: private static final Class<UsernamePasswordCredential> DEFAULT_CLASS = UsernamePasswordCredential.class;
focal_class.type: Class<UsernamePasswordCredential>
focal_class.var_name: DEFAULT_CLASS
focal_class.declarator: classToSupport = DEFAULT_CLASS
focal_class.modifier: private
focal_class.original_string: private Class<?> classToSupport = DEFAULT_CLASS;
focal_class.type: Class<?>
focal_class.var_name: classToSupport
focal_class.declarator: supportSubClasses = true
focal_class.modifier: private
focal_class.original_string: private boolean supportSubClasses = true;
focal_class.type: boolean
focal_class.var_name: supportSubClasses
focal_class.file: ki4so-core/src/main/java/com/github/ebnew/ki4so/core/authentication/resolvers/UsernamePasswordCredentialToPrincipalResolver.java
focal_class.identifier: UsernamePasswordCredentialToPrincipalResolver
focal_class.interfaces: implements CredentialToPrincipalResolver
focal_class.class_method_signature: UsernamePasswordCredentialToPrincipalResolver.setSupportSubClasses(boolean supportSubClasses)
focal_class.full_signature: public void setSupportSubClasses(boolean supportSubClasses)
focal_class.identifier: setSupportSubClasses
focal_class.modifiers: public
focal_class.parameters: (boolean supportSubClasses)
focal_class.return: void
focal_class.signature: void setSupportSubClasses(boolean supportSubClasses)
focal_class.class_method_signature: UsernamePasswordCredentialToPrincipalResolver.resolvePrincipal(Credential credential)
focal_class.full_signature: @Override public Principal resolvePrincipal(Credential credential)
focal_class.identifier: resolvePrincipal
focal_class.modifiers: @Override public
focal_class.parameters: (Credential credential)
focal_class.return: Principal
focal_class.signature: Principal resolvePrincipal(Credential credential)
focal_class.class_method_signature: UsernamePasswordCredentialToPrincipalResolver.supports(Credential credential)
focal_class.full_signature: @Override public boolean supports(Credential credential)
focal_class.identifier: supports
focal_class.modifiers: @Override public
focal_class.parameters: (Credential credential)
focal_class.return: boolean
focal_class.signature: boolean supports(Credential credential)
focal_method.body: @Override
  	public boolean supports(Credential credential) {
  		return credential != null
  		&& (this.classToSupport.equals(credential.getClass()) || (this.classToSupport
  				.isAssignableFrom(credential.getClass()))
  				&& this.supportSubClasses);
  	}
focal_method.class_method_signature: UsernamePasswordCredentialToPrincipalResolver.supports(Credential credential)
focal_method.full_signature: @Override public boolean supports(Credential credential)
focal_method.identifier: supports
focal_method.invocations: equals getClass isAssignableFrom getClass
focal_method.modifiers: @Override public
focal_method.parameters: (Credential credential)
focal_method.return: boolean
focal_method.signature: boolean supports(Credential credential)