### Question:
BrandPortalSyncProcess implements WorkflowProcess { public final void execute(WorkItem workItem, WorkflowSession workflowSession, MetaDataMap metaDataMap) throws WorkflowException { final List<String> assetPaths = new ArrayList<String>(); final ReplicationActionType replicationActionType = getReplicationActionType(metaDataMap); try (ResourceResolver resourceResolver = workflowHelper.getResourceResolver(workflowSession)) { final List<String> payloads = workflowPackageManager.getPaths(resourceResolver, (String) workItem.getWorkflowData().getPayload()); for (final String payload : payloads) { final Asset asset = DamUtil.resolveToAsset(resourceResolver.getResource(payload)); if (asset == null) { log.debug("Payload path [ {} ] does not resolve to an asset", payload); } else { assetPaths.add(asset.getPath()); } } if (ReplicationActionType.ACTIVATE.equals(replicationActionType)) { damSyncService.publishResourcesToMP(assetPaths, resourceResolver); } else if (ReplicationActionType.DEACTIVATE.equals(replicationActionType)) { damSyncService.unpublishResourcesFromMP(assetPaths, resourceResolver); } else { log.warn("Unknown replication action type [ {} ] for AEM Assets Brand Portal Sync", replicationActionType); } } catch (RepositoryException e) { log.error("Could not find the payload", e); throw new WorkflowException("Could not find the payload"); } }  final void execute(WorkItem workItem, WorkflowSession workflowSession, MetaDataMap metaDataMap);  }### Answer:
@Test public void execute_activate() throws Exception { metadataMap.put("PROCESS_ARGS", "activate"); workflowProcess.execute(workItem, workflowSession, metadataMap); verify(damSyncService, times(1)).publishResourcesToMP(any(List.class), eq(context.resourceResolver())); }
@Test public void execute_deactivate() throws Exception { metadataMap.put("PROCESS_ARGS", "deactivate"); workflowProcess.execute(workItem, workflowSession, metadataMap); verify(damSyncService, times(1)).unpublishResourcesFromMP(any(List.class), eq(context.resourceResolver())); }