StorageProviderBase implements StorageProvider { public void setSpaceACLs(String spaceId, Map<String, AclType> spaceACLs) { Map<String, String> newProps = new HashMap<>(); Map<String, String> spaceProps = getSpaceProperties(spaceId); newProps.putAll(spaceProps); newProps.putAll(packACLs(spaceACLs)); doSetSpaceProperties(spaceId, newProps); }  Map<String, String> getSpaceProperties(String spaceId); void setNewSpaceProperties(String spaceId,
                                      Map<String, String> spaceProperties); void setNewSpaceProperties(String spaceId,
                                      Map<String, String> spaceProperties,
                                      Map<String, AclType> spaceACLs); Map<String, AclType> getSpaceACLs(String spaceId); void setSpaceACLs(String spaceId, Map<String, AclType> spaceACLs); void deleteSpace(String spaceId); void deleteSpaceSync(String spaceId); SpaceDeleteWorker getSpaceDeleteWorker(String spaceId); void setWrappedStorageProvider(StorageProvider wrappedStorageProvider);  }
@Test public void testSetSpaceACLs() { EasyMock.expect(providerMock.getAllSpaceProperties(spaceId)).andReturn( spaceProps); Map<String, AclType> newProps = new HashMap<>(); newProps.put(aclPrefix + userRead0, AclType.READ); newProps.put(aclPrefix + userRead1, AclType.READ); newProps.put(aclPrefix + userWrite0, AclType.WRITE); newProps.put(aclGroupPrefix + groupRead0, AclType.READ); newProps.put(aclGroupPrefix + groupWrite0, AclType.WRITE); newProps.put(aclGroupPrefix + groupWrite1, AclType.WRITE); Capture<Map<String, String>> propsSetCapture = new Capture<>(); providerMock.doSetSpaceProperties(EasyMock.eq(spaceId), EasyMock.capture(propsSetCapture)); EasyMock.expectLastCall().once(); replayMocks(); providerBase.setSpaceACLs(spaceId, newProps); Map<String, String> propsSet = propsSetCapture.getValue(); Assert.assertNotNull(propsSet); String userRead = propsSet.get(StorageProviderBase.ACL_USER_READ); Assert.assertNotNull(userRead); Assert.assertTrue(userRead.contains(userRead0)); Assert.assertTrue(userRead.contains(userRead1)); String userWrite = propsSet.get(StorageProviderBase.ACL_USER_WRITE); Assert.assertNotNull(userWrite); Assert.assertTrue(userWrite.contains(userWrite0)); String groupRead = propsSet.get(StorageProviderBase.ACL_GROUP_READ); Assert.assertNotNull(groupRead); Assert.assertTrue(groupRead.contains(groupRead0)); String groupWrite = propsSet.get(StorageProviderBase.ACL_GROUP_WRITE); Assert.assertNotNull(groupWrite); Assert.assertTrue(groupWrite.contains(groupWrite0)); Assert.assertTrue(groupWrite.contains(groupWrite1)); }