### Question:
PdfDestinationPane extends DestinationPane implements ModuleOwned, RestorableView, ResettableView,
        TaskParametersBuildStep<AbstractPdfOutputParametersBuilder<? extends AbstractPdfOutputParameters>> { @EventListener public void setDestination(SetDestinationRequest event) { if (!event.isFallback() || (isBlank(destination().getTextField().getText()) && userContext.isUseSmartOutput())) { destination().setTextFromFile(event.getFootprint()); } } PdfDestinationPane(BrowsableField destination, String ownerModule, UserContext userContext,
            DestinationPanelFields... optionalFields);  PdfDestinationPane(BrowsableField destination, String ownerModule, UserContext userContext,
            boolean expandAdvanced, DestinationPanelFields... optionalFields); void enableSameAsSourceItem(); @Override @EventStation String getOwnerModule(); @EventListener void setDestination(SetDestinationRequest event); @Override void resetView(); @Override void apply(AbstractPdfOutputParametersBuilder<? extends AbstractPdfOutputParameters> builder,
            Consumer<String> onError); @Override void saveStateTo(Map<String, String> data); @Override void restoreStateFrom(Map<String, String> data);  }### Answer:
@Test public void setDestination() throws IOException { File footprint = folder.newFile("test.pdf"); SetDestinationRequest event = SetDestinationRequest.requestDestination(footprint, MODULE); victim.setDestination(event); verify(destination).setTextFromFile(event.getFootprint()); }
@Test public void setFallbackDestination() throws IOException { destination.getTextField().setText(""); when(userContext.isUseSmartOutput()).thenReturn(Boolean.TRUE); File footprint = folder.newFile("test.pdf"); SetDestinationRequest event = SetDestinationRequest.requestFallbackDestination(footprint, MODULE); victim.setDestination(event); verify(destination).setTextFromFile(event.getFootprint()); }
@Test public void dontSetFallbackDestinationIfFilled() throws IOException { destination.getTextField().setText("ChuckNorris"); File footprint = folder.newFile("test.pdf"); SetDestinationRequest event = SetDestinationRequest.requestDestination(footprint, MODULE); victim.setDestination(event); verify(destination).setTextFromFile(event.getFootprint()); }
@Test public void dontSetFallbackDestinationIfNoSmartOutput() throws IOException { File footprint = folder.newFile("test.pdf"); SetDestinationRequest event = SetDestinationRequest.requestFallbackDestination(footprint, MODULE); victim.setDestination(event); verify(destination, never()).setTextFromFile(any()); }