### Question:
AnnotationsShiroAuthorizationStrategy implements IAuthorizationStrategy { public boolean isActionAuthorized(final Component component, final Action action) { final ShiroAction _action = action.getName().equals(Action.RENDER) ? ShiroAction.RENDER : ShiroAction.ENABLE; final Class<? extends Component> clazz = component.getClass(); Annotation[] componentClassAnnotations = clazz.getAnnotations(); ShiroSecurityConstraint fail = checkInvalidInstantiation( findShiroSecurityConstraintAnnotations(componentClassAnnotations), _action ); if (fail == null) { Annotation[] packageAnnotations = clazz.getPackage().getAnnotations(); fail = checkInvalidInstantiation(findShiroSecurityConstraintAnnotations(packageAnnotations), _action); } return fail == null; }  ShiroSecurityConstraint checkInvalidInstantiation(
		final Class<T> componentClass); boolean isActionAuthorized(final Component component, final Action action); @Override boolean isResourceAuthorized(IResource resource, PageParameters parameters); boolean isInstantiationAuthorized(
		final Class<T> componentClass);  }### Answer:
@Test public void checkRenderWhenLoggedIn() { isLoggedIn = true; assertTrue(underTest.isActionAuthorized(new RenderWhen.LoggedInOnly(), RENDER)); }
@Test public void checkRenderWhenNotLoggedIn() { isLoggedIn = false; assertFalse(underTest.isActionAuthorized(new RenderWhen.LoggedInOnly(), RENDER)); }
@Test public void checkRenderWhenAuthenticated() { isAuthenticated = true; assertTrue(underTest.isActionAuthorized(new RenderWhen.AuthenticatedOnly(), RENDER)); }
@Test public void checkRenderWhenNotAuthenticated() { isLoggedIn = false; assertFalse(underTest.isActionAuthorized(new RenderWhen.AuthenticatedOnly(), RENDER)); }
@Test public void checkRenderForRole() { role = "ADMIN"; assertTrue(underTest.isActionAuthorized(new RenderWhen.SubjectHasRole(), RENDER)); }
@Test public void checkRenderForRoleNotPresent() { role = "USER"; assertFalse(underTest.isActionAuthorized(new RenderWhen.SubjectHasRole(), RENDER)); }
@Test public void checkRenderForPermission() { persmission = "any:permission"; assertTrue(underTest.isActionAuthorized(new RenderWhen.SubjectHasPermission(), RENDER)); }
@Test public void checkRenderForPermissionNotPresent() { persmission = "no:permission"; assertFalse(underTest.isActionAuthorized(new RenderWhen.SubjectHasPermission(), RENDER)); }
@Test public void checkEnableWhenLoggedIn() { isLoggedIn = true; assertTrue(underTest.isActionAuthorized(new EnableWhen.LoggedInOnly(), ENABLE)); }
@Test public void checkEnableWhenNotLoggedIn() { isLoggedIn = false; assertFalse(underTest.isActionAuthorized(new EnableWhen.LoggedInOnly(), ENABLE)); }
@Test public void checkEnableWhenAuthenticated() { isAuthenticated = true; assertTrue(underTest.isActionAuthorized(new EnableWhen.AuthenticatedOnly(), ENABLE)); }
@Test public void checkEnableWhenNotAuthenticated() { isLoggedIn = false; assertFalse(underTest.isActionAuthorized(new EnableWhen.AuthenticatedOnly(), ENABLE)); }
@Test public void checkEnableForRole() { role = "ADMIN"; assertTrue(underTest.isActionAuthorized(new EnableWhen.SubjectHasRole(), ENABLE)); }
@Test public void checkEnableForRoleNotPresent() { role = "USER"; assertFalse(underTest.isActionAuthorized(new EnableWhen.SubjectHasRole(), ENABLE)); }
@Test public void checkEnableForPermission() { persmission = "any:permission"; assertTrue(underTest.isActionAuthorized(new EnableWhen.SubjectHasPermission(), ENABLE)); }
@Test public void checkEnableForPermissionNotPresent() { persmission = "no:permission"; assertFalse(underTest.isActionAuthorized(new EnableWhen.SubjectHasPermission(), ENABLE)); }