package com.atlassian.stash.internal.user;

import com.atlassian.bitbucket.user.ApplicationUser;
import com.atlassian.bitbucket.permission.Permission;
import org.junit.Test;

public class PermissionCriteriaTest {

    @Test(expected = IllegalArgumentException.class)
    public void testUserCriteriaWithInvalidResource() throws Exception {
        ApplicationUser user = new InternalNormalUser.Builder().id(1).name("user").build();
        new UserPermissionCriteria.Builder(user).permission(Permission.LICENSED_USER).resource(new Object()).build();
    }

    @Test(expected = IllegalArgumentException.class)
    public void testGroupCriteriaWithInvalidResource() throws Exception {
        new GroupPermissionCriteria.Builder("group").permission(Permission.LICENSED_USER).resource(new Object()).build();
    }

}
