### Question:
WorkflowRemover extends ProcessDefinition { void performCleanupActivity(ActionManager manager) throws Exception { manager.withResolver(rr -> { parseParameters(); workflowInstanceRemover.removeWorkflowInstances(rr, modelIds, statuses, payloads, olderThan, BATCH_SIZE, MAX_DURATION_MINS); WorkflowRemovalStatus status = workflowInstanceRemover.getStatus(); EnumMap<ReportColumns, Object> reportRow = report(status); reportRows.add(reportRow); }); } WorkflowRemover(WorkflowInstanceRemover workflowInstanceRemover); @Override void buildProcess(ProcessInstance instance, ResourceResolver rr); @Override void storeReport(ProcessInstance instance, ResourceResolver rr); @Override void init(); List<String> getModelIds(); List<Pattern> getPayloads(); Calendar getOlderThan(); List<String> getStatuses(); @FormField(name = "Workflow Payload Paths", description = "Payload path regex", hint = "/content/dam/.*",
            component = MultifieldComponent.class)
    public List<String> payloadPaths; @FormField(name = "Workflows Older Than", description = "only remove workflows older than the specified date",
            component = DatePickerComponent.class)
    public String olderThanVal; @FormField(
            name = "Workflow Models",
            description = "If no Workflow Models are selected, Workflow Instances will not be filtered by Workflow Model.",
            component = MultifieldComponent.class, options = { MultifieldComponent.USE_CLASS
                    + "=com.adobe.acs.commons.mcp.form.workflow.WorkflowModelSelector" })
    public List<String> modelIds; @FormField(name = "Workflow Statuses", component = MultifieldComponent.class, required = true,
            options = { MultifieldComponent.USE_CLASS
                    + "=com.adobe.acs.commons.mcp.form.workflow.WorkflowStatusSelector" })
    public List<String> statuses; }### Answer:
@Test public void performCleanupActivity() throws Exception { WorkflowRemovalStatus statusVal = new WorkflowRemovalStatus(ctx.resourceResolver()); Mockito.when(workflowInstanceRemover.getStatus()).thenReturn(statusVal); remover.performCleanupActivity(actionManager); Mockito.verify(workflowInstanceRemover, Mockito.times(1)).removeWorkflowInstances(Mockito.eq(ctx.resourceResolver()), Mockito.eq(remover.getModelIds()), Mockito.eq(remover.getStatuses()), Mockito.eq(remover.getPayloads()), Mockito.eq(remover.getOlderThan()), Mockito.anyInt(), Mockito.anyInt()); }