### Question:
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);  }### Answer:
@Test public void showWithPermissionTest() { final OrganizationalUnit organizationalUnit = mock(OrganizationalUnit.class); doReturn("ou-name").when(organizationalUnit).getName(); presenter.show(organizationalUnit); verify(view).show(organizationalUnit.getName()); assertEquals(organizationalUnit, presenter.organizationalUnit); }
@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); }