@Test public void showWithoutPermissionTest() { final OrganizationalUnit organizationalUnit = mock(OrganizationalUnit.class); doReturn("ou-name").when(organizationalUnit).getName(); doReturn(false).when(organizationalUnitController).canDeleteOrgUnit(organizationalUnit); presenter.show(organizationalUnit); verify(view, never()).show(organizationalUnit.getName()); assertNull(presenter.organizationalUnit); }
public void show(final OrganizationalUnit organizationalUnit) { if (organizationalUnitController.canDeleteOrgUnit(organizationalUnit)) { this.organizationalUnit = organizationalUnit; view.show(organizationalUnit.getName()); } }
DeleteOrganizationalUnitPopUpPresenter { public void show(final OrganizationalUnit organizationalUnit) { if (organizationalUnitController.canDeleteOrgUnit(organizationalUnit)) { this.organizationalUnit = organizationalUnit; view.show(organizationalUnit.getName()); } } }
DeleteOrganizationalUnitPopUpPresenter { public void show(final OrganizationalUnit organizationalUnit) { if (organizationalUnitController.canDeleteOrgUnit(organizationalUnit)) { this.organizationalUnit = organizationalUnit; view.show(organizationalUnit.getName()); } } @Inject  DeleteOrganizationalUnitPopUpPresenter(final View view,
                                                  final Caller<OrganizationalUnitService> organizationalUnitService,
                                                  final OrganizationalUnitController organizationalUnitController,
                                                  final Event<NotificationEvent> notificationEvent,
                                                  final LibraryPlaces libraryPlaces); }
DeleteOrganizationalUnitPopUpPresenter { public void show(final OrganizationalUnit organizationalUnit) { if (organizationalUnitController.canDeleteOrgUnit(organizationalUnit)) { this.organizationalUnit = organizationalUnit; view.show(organizationalUnit.getName()); } } @Inject  DeleteOrganizationalUnitPopUpPresenter(final View view,
                                                  final Caller<OrganizationalUnitService> organizationalUnitService,
                                                  final OrganizationalUnitController organizationalUnitController,
                                                  final Event<NotificationEvent> notificationEvent,
                                                  final LibraryPlaces libraryPlaces); @PostConstruct void setup(); void show(final OrganizationalUnit organizationalUnit); void delete(); void cancel(); void onOrganizationalUnitRemoved(@Observes final RemoveOrganizationalUnitEvent removedOrganizationalUnitEvent); }
DeleteOrganizationalUnitPopUpPresenter { public void show(final OrganizationalUnit organizationalUnit) { if (organizationalUnitController.canDeleteOrgUnit(organizationalUnit)) { this.organizationalUnit = organizationalUnit; view.show(organizationalUnit.getName()); } } @Inject  DeleteOrganizationalUnitPopUpPresenter(final View view,
                                                  final Caller<OrganizationalUnitService> organizationalUnitService,
                                                  final OrganizationalUnitController organizationalUnitController,
                                                  final Event<NotificationEvent> notificationEvent,
                                                  final LibraryPlaces libraryPlaces); @PostConstruct void setup(); void show(final OrganizationalUnit organizationalUnit); void delete(); void cancel(); void onOrganizationalUnitRemoved(@Observes final RemoveOrganizationalUnitEvent removedOrganizationalUnitEvent);  }