### Question:
DeleteOrganizationalUnitPopUpPresenter { public void delete() { final String confirmedName = view.getConfirmedName(); if (!organizationalUnit.getName().equals(confirmedName)) { view.showError(view.getWrongConfirmedNameValidationMessage()); return; } view.showBusyIndicator(view.getDeletingMessage()); organizationalUnitService.call(v -> { view.hideBusyIndicator(); notificationEvent.fire(new NotificationEvent(view.getDeleteSuccessMessage(), NotificationEvent.NotificationType.SUCCESS)); view.hide(); libraryPlaces.goToOrganizationalUnits(); }, new HasBusyIndicatorDefaultErrorCallback(view)).removeOrganizationalUnit(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 deleteWithWrongConfirmedNameTest() { presenter.organizationalUnit = mock(OrganizationalUnit.class); doReturn("ou-name").when(presenter.organizationalUnit).getName(); doReturn("other").when(view).getConfirmedName(); presenter.delete(); verify(view).getWrongConfirmedNameValidationMessage(); verify(view).showError(anyString()); verify(organizationalUnitService, never()).removeOrganizationalUnit(anyString()); }
@Test public void deleteTest() { presenter.organizationalUnit = mock(OrganizationalUnit.class); doReturn("ou-name").when(presenter.organizationalUnit).getName(); doReturn("ou-name").when(view).getConfirmedName(); presenter.delete(); verify(view).showBusyIndicator(anyString()); verify(view).hideBusyIndicator(); verify(notificationEvent).fire(any()); verify(view).hide(); verify(libraryPlaces).goToOrganizationalUnits(); verify(organizationalUnitService).removeOrganizationalUnit(presenter.organizationalUnit.getName()); }