@@ -0,0 +1,1750 @@
+package net.sf.jguard.core.authorization.policy;%0A%0Aimport net.sf.jguard.core.authorization.manager.MockAuthorizationManager;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.mockito.InjectMocks;%0Aimport org.mockito.Mock;%0Aimport org.mockito.MockitoAnnotations;%0A%0Aimport javax.security.auth.Subject;%0Aimport java.security.AccessControlException;%0Aimport java.security.AllPermission;%0Aimport java.security.Permission;%0Aimport java.security.Permissions;%0A%0Aimport static org.hamcrest.core.Is.is;%0Aimport static org.junit.Assert.assertThat;%0Aimport static org.mockito.Matchers.any;%0Aimport static org.mockito.Mockito.doThrow;%0A%0A%0Apublic class AccessControllerWrapperImplTest %7B%0A%0A    private SingleAppPolicy policy = new SingleAppPolicy(new MockAuthorizationManager(), new Permissions());%0A%0A    @Mock%0A    LocalAccessController localAccessController;%0A%0A    @InjectMocks%0A    private AccessControllerWrapperImpl accessControllerWrapper = new AccessControllerWrapperImpl(policy);%0A%0A    @Before%0A    public void setUp() throws Exception %7B%0A        MockitoAnnotations.initMocks(this);%0A    %7D%0A%0A    @Test%0A    public void testHasPermission_nominal_case() throws Exception %7B%0A%0A        //when%0A        accessControllerWrapper.hasPermission(new Subject(), new AllPermission());%0A%0A    %7D%0A%0A    @Test%0A    public void testHasPermission_with_internal_exception() throws Exception %7B%0A        //given%0A        doThrow(new AccessControlException(%22name%22)).when(localAccessController).checkPermission(any(Permission.class));%0A%0A        //when%0A        boolean hasPermission = accessControllerWrapper.hasPermission(new Subject(), new AllPermission());%0A%0A        //then%0A        assertThat(hasPermission, is(false));%0A%0A    %7D%0A%0A%0A    @Test%0A    public void testCheckPermission() throws Exception %7B%0A%0A    %7D%0A%7D%0A

add unit test