verify(pluginsPermissionFactory, never()).buildFromName(anyString());
}
@Test
public void buildFromNameShouldReturnPluginPermissionWhenCommonNotFound() {
JtalksPermission targetPermission = BranchPermission.VIEW_TOPICS;
when(jtalksPermissionFactory.buildFromName(anyString())).thenReturn(null);
when(pluginsPermissionFactory.buildFromName(targetPermission.getName())).thenReturn(targetPermission);
JCPermissionFactory permissionFactory = new JCPermissionFactory(jtalksPermissionFactory,pluginsPermissionFactory);
Permission result = permissionFactory.buildFromName(targetPermission.getName());
assertEquals(result, targetPermission);
verify(jtalksPermissionFactory).buildFromName(targetPermission.getName());
}