Hello all,
 
I am trying to build mock subject for my tests. In my system I use the 
following code to check authorization:
        var permission = new ResourcePermission(this.getResourceId(), action);
        if (!subject.isPermitted(permission)) {
            throw new AuthorizationException();
        }
 
Now, I am trying to build a mock subject for my test:
 
        Subject subjectUnderTest = new Subject
                .Builder(securityManager)
                .authenticated(true)
                .???
                .buildSubject();
 
Could anyone say, how to build a mock subject having certain permissions? Or do 
I miss something?
 
 
 
 
--
Best regards, Alex Orlov

Reply via email to