Authentication auth2 = getFeatureAuthentication();
authentications.add(auth1);
authentications.add(auth2);
securityContext.setAuthentications("token", authentications);
InternalFeature feature = new InternalFeatureImpl();
Map<String, Attribute> attributes = new HashMap<String, Attribute>();
feature.setAttributes(attributes);
attributes.put(ATTRIBUTE_ID, new StringAttribute("bla"));
Assert.assertTrue(securityContext.isFeatureVisible(LAYER_ID, feature));
Assert.assertTrue(securityContext.isFeatureUpdateAuthorized(LAYER_ID, feature));
Assert.assertTrue(securityContext.isFeatureUpdateAuthorized(LAYER_ID, feature, feature));
Assert.assertTrue(securityContext.isFeatureDeleteAuthorized(LAYER_ID, feature));
Assert.assertTrue(securityContext.isFeatureCreateAuthorized(LAYER_ID, feature));
feature.getAttributes().put(ATTRIBUTE_ID, new StringAttribute("vis"));
Assert.assertFalse(securityContext.isFeatureVisible(LAYER_ID, feature));
Assert.assertTrue(securityContext.isFeatureUpdateAuthorized(LAYER_ID, feature));
Assert.assertTrue(securityContext.isFeatureUpdateAuthorized(LAYER_ID, feature, feature));
Assert.assertTrue(securityContext.isFeatureDeleteAuthorized(LAYER_ID, feature));
Assert.assertTrue(securityContext.isFeatureCreateAuthorized(LAYER_ID, feature));
feature.getAttributes().put(ATTRIBUTE_ID, new StringAttribute("cre"));
Assert.assertTrue(securityContext.isFeatureVisible(LAYER_ID, feature));
Assert.assertTrue(securityContext.isFeatureUpdateAuthorized(LAYER_ID, feature));
Assert.assertTrue(securityContext.isFeatureUpdateAuthorized(LAYER_ID, feature, feature));
Assert.assertTrue(securityContext.isFeatureDeleteAuthorized(LAYER_ID, feature));
Assert.assertFalse(securityContext.isFeatureCreateAuthorized(LAYER_ID, feature));
feature.getAttributes().put(ATTRIBUTE_ID, new StringAttribute("upd"));
Assert.assertTrue(securityContext.isFeatureVisible(LAYER_ID, feature));
Assert.assertFalse(securityContext.isFeatureUpdateAuthorized(LAYER_ID, feature));
Assert.assertTrue(securityContext.isFeatureUpdateAuthorized(LAYER_ID, feature, feature));
Assert.assertTrue(securityContext.isFeatureDeleteAuthorized(LAYER_ID, feature));
Assert.assertTrue(securityContext.isFeatureCreateAuthorized(LAYER_ID, feature));
feature.getAttributes().put(ATTRIBUTE_ID, new StringAttribute("org"));
Assert.assertTrue(securityContext.isFeatureVisible(LAYER_ID, feature));
Assert.assertTrue(securityContext.isFeatureUpdateAuthorized(LAYER_ID, feature));
Assert.assertFalse(securityContext.isFeatureUpdateAuthorized(LAYER_ID, feature, feature));
Assert.assertTrue(securityContext.isFeatureDeleteAuthorized(LAYER_ID, feature));
Assert.assertTrue(securityContext.isFeatureCreateAuthorized(LAYER_ID, feature));
feature.getAttributes().put(ATTRIBUTE_ID, new StringAttribute("new"));
Assert.assertTrue(securityContext.isFeatureVisible(LAYER_ID, feature));
Assert.assertTrue(securityContext.isFeatureUpdateAuthorized(LAYER_ID, feature));
Assert.assertFalse(securityContext.isFeatureUpdateAuthorized(LAYER_ID, feature, feature));
Assert.assertTrue(securityContext.isFeatureDeleteAuthorized(LAYER_ID, feature));
Assert.assertTrue(securityContext.isFeatureCreateAuthorized(LAYER_ID, feature));
feature.getAttributes().put(ATTRIBUTE_ID, new StringAttribute("del"));
Assert.assertTrue(securityContext.isFeatureVisible(LAYER_ID, feature));
Assert.assertTrue(securityContext.isFeatureUpdateAuthorized(LAYER_ID, feature));
Assert.assertTrue(securityContext.isFeatureUpdateAuthorized(LAYER_ID, feature, feature));
Assert.assertFalse(securityContext.isFeatureDeleteAuthorized(LAYER_ID, feature));
Assert.assertTrue(securityContext.isFeatureCreateAuthorized(LAYER_ID, feature));