### Question:
ProcessHandler { public Optional<EntityDetail> findProcessEntity(String userId, String qualifiedName) throws UserNotAuthorizedException, PropertyServerException, InvalidParameterException { return dataEngineCommonHandler.findEntity(userId, qualifiedName, ProcessPropertiesMapper.PROCESS_TYPE_NAME); } ProcessHandler(String serviceName, String serverName, InvalidParameterHandler invalidParameterHandler,
                          RepositoryHandler repositoryHandler, OMRSRepositoryHelper repositoryHelper, AssetHandler assetHandler,
                          DataEngineCommonHandler dataEngineCommonHandler, List<String> defaultZones, List<String> supportedZones); void setSecurityVerifier(OpenMetadataServerSecurityVerifier securityVerifier); String createProcess(String userId, Process process, String externalSourceName); void updateProcess(String userId, EntityDetail originalProcessEntity, Process updatedProcess); Optional<EntityDetail> findProcessEntity(String userId, String qualifiedName); void addProcessPortRelationship(String userId, String processGUID, String portGUID, String externalSourceName); void updateProcessStatus(String userId, String guid, InstanceStatus instanceStatus); Set<String> getPortsForProcess(String userId, String processGUID, String portTypeName); void createOrUpdateProcessHierarchyRelationship(String userId, ParentProcess parentProcess, String processGUID,
                                                           String externalSourceName);  }### Answer:
@Test void findProcess() throws UserNotAuthorizedException, PropertyServerException, InvalidParameterException { EntityDetail entityDetail = mock(EntityDetail.class); when(entityDetail.getGUID()).thenReturn(GUID); Optional<EntityDetail> optionalOfMockedEntity = Optional.of(entityDetail); when(dataEngineCommonHandler.findEntity(USER, QUALIFIED_NAME, ProcessPropertiesMapper.PROCESS_TYPE_NAME)).thenReturn(optionalOfMockedEntity); Optional<EntityDetail> result = processHandler.findProcessEntity(USER, QUALIFIED_NAME); assertEquals(GUID, result.get().getGUID()); }
@Test void findProcess_notExisting() throws UserNotAuthorizedException, PropertyServerException, InvalidParameterException { when(dataEngineCommonHandler.findEntity(USER, QUALIFIED_NAME, ProcessPropertiesMapper.PROCESS_TYPE_NAME)).thenReturn(Optional.empty()); Optional<EntityDetail> result = processHandler.findProcessEntity(USER, QUALIFIED_NAME); assertFalse(result.isPresent()); }