verify(pluginsPermissionFactory).buildFromName(targetPermission.getName());
}
@Test
public void buildFromNamesShouldReturnBothOfCommonAndPluginPermissions() {
JtalksPermission commonPermission = BranchPermission.VIEW_TOPICS;
JtalksPermission pluginPermission = BranchPermission.CLOSE_TOPICS;
List<String> names = Arrays.asList(commonPermission.getName(), pluginPermission.getName());
List<Permission> expected = Arrays.asList((Permission)commonPermission, (Permission)pluginPermission);
when(jtalksPermissionFactory.buildFromNames(names)).thenReturn(Arrays.asList((Permission)commonPermission));
when(pluginsPermissionFactory.buildFromNames(names)).thenReturn(Arrays.asList((Permission)pluginPermission));
JCPermissionFactory permissionFactory = new JCPermissionFactory(jtalksPermissionFactory,pluginsPermissionFactory);