### Question:
GroupsPermissionsVm { @Command public void showGroupsDialog(@BindingParam("entity") Entity entity, @BindingParam("permission") JtalksPermission permission, @BindingParam("mode") String mode) { selectedEntity.setEntity(new PermissionForEntity(entity, mode, permission)); windowManager.open(MANAGE_GROUPS_DIALOG_ZUL); } GroupsPermissionsVm(@Nonnull WindowManager windowManager,
                               @Nonnull ComponentService componentService,
                               @Nonnull PermissionsService permissionsService,
                               @Nonnull SelectedEntity<Object> selectedEntity); List<EntityPermissionsBlock> getBlocks(); @Command void showGroupsDialog(@BindingParam("entity") Entity entity,
            @BindingParam("permission") JtalksPermission permission, @BindingParam("mode") String mode); static final String MANAGE_GROUPS_DIALOG_ZUL; }### Answer:
@Test(dataProvider = "dataProviderForShowGroupsDialog") public void testShowGroupsDialog(Entity entity, JtalksPermission permission, String mode) { viewModel.showGroupsDialog(entity, permission, mode); PermissionForEntity pfe = (PermissionForEntity) selectedEntity.getEntity(); assertEquals(pfe.getPermission(), permission); assertEquals(pfe.getTarget(), entity); assertEquals(pfe.isAllowed(), "allow".equalsIgnoreCase(mode)); verify(windowManager).open(anyString()); }
@Test(expectedExceptions = { IllegalArgumentException.class }) public void testShowGroupsDialogWithIllegalData() { viewModel.showGroupsDialog(null, null, null); }