GroupCreationWorkflow implements IsWidget { public void create() { clear(); view.setWidget(createEntity.asWidget()) .setSaveButtonVisible(true) .setSaveButtonEnabled(true) .setSaveButtonText(UsersManagementWidgetsConstants.INSTANCE.next()) .setCancelButtonVisible(false) .setCallback(new EntityWorkflowView.Callback() { @Override public void onSave() { GroupCreationWorkflow.this.checkCreate(); } @Override public void onCancel() { create(); } }); createEntity.show(UsersManagementWidgetsConstants.INSTANCE.inputGroupName(), UsersManagementWidgetsConstants.INSTANCE.groupName() + "..."); } @Inject  GroupCreationWorkflow(final ClientUserSystemManager userSystemManager,
                                 final Caller<AuthorizationService> authorizationService,
                                 final PermissionManager permissionManager,
                                 final Event<OnErrorEvent> errorEvent,
                                 final ConfirmBox confirmBox,
                                 final LoadingBox loadingBox,
                                 final Event<NotificationEvent> workbenchNotification,
                                 final CreateEntity createEntity,
                                 final GroupUsersAssignment groupUsersAssignment,
                                 final Event<CreateGroupEvent> onCreateGroupEvent,
                                 final EntityWorkflowView view); @PostConstruct void init(); void create(); void clear(); @Override Widget asWidget();  }
@Test public void testCreate() { tested.create(); verify(createEntity, times(1)).show(anyString(), anyString()); verify(view, times(1)).setCancelButtonVisible(false); verify(view, times(1)).setCallback(any(EntityWorkflowView.Callback.class)); verify(view, times(1)).setSaveButtonText(anyString()); verify(view, times(1)).setWidget(any(IsWidget.class)); verify(view, times(1)).setSaveButtonVisible(true); verify(view, times(1)).setSaveButtonEnabled(true); verify(view, times(1)).clearNotifications(); }