public void testResolve() throws Exception {
final UsernameFunctionProcessor processor = new UsernameFunctionProcessor();
assertThat( processor.resolve( null, null ), nullValue() );
assertThat( processor.resolve( null, Arrays.asList( "test-input" ) ), contains( "test-input" ) );
Subject subject = new Subject();
subject.getPrincipals().add( new PrimaryPrincipal( "test-username" ) );
subject.setReadOnly();
Subject.doAs( subject, new PrivilegedExceptionAction<Object>() {
@Override
public Object run() throws Exception {
assertThat( processor.resolve( null, null ), contains( "test-username" ) );