NullDomainImpl nullDomainImpl = new NullDomainImpl("foo");
MethodInvocation invocation = MethodInvocationUtils.create(nullDomainImpl, "nullMethod", new Object());
attributeStore.putAttribute(nullDomainImpl, new SecurityAttributeEntry("name", "service.foo"));
ServicePermission permission = new ServicePermission();
permission.setInstance("service.foo");
userManager.addPermissionToUser("testuser", permission);
assertThat(accessControl.checkAccess("testuser", invocation), Matchers.is(Access.GRANTED));
}