Search in sources :

Example 91 with WorkflowDTO

use of org.wso2.carbon.apimgt.impl.dto.WorkflowDTO in project carbon-apimgt by wso2.

the class APIProviderImpl method changeLifeCycleStatus.

/**
 * This method is to change registry lifecycle states for an API or API Product artifact
 *
 * @param orgId          UUID of the organization
 * @param apiTypeWrapper API Type Wrapper
 * @param action         Action which need to execute from registry lifecycle
 * @param checklist      checklist items
 * @return APIStateChangeResponse API workflow state and WorkflowResponse
 */
@Override
public APIStateChangeResponse changeLifeCycleStatus(String orgId, ApiTypeWrapper apiTypeWrapper, String action, Map<String, Boolean> checklist) throws APIManagementException, FaultGatewaysException {
    APIStateChangeResponse response = new APIStateChangeResponse();
    try {
        PrivilegedCarbonContext.startTenantFlow();
        PrivilegedCarbonContext.getThreadLocalCarbonContext().setUsername(this.username);
        PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantDomain(this.tenantDomain, true);
        String targetStatus;
        String providerName;
        String apiName;
        String apiContext;
        String apiType;
        String apiVersion;
        String currentStatus;
        String uuid;
        int apiOrApiProductId;
        boolean isApiProduct = apiTypeWrapper.isAPIProduct();
        String workflowType;
        if (isApiProduct) {
            APIProduct apiProduct = apiTypeWrapper.getApiProduct();
            providerName = apiProduct.getId().getProviderName();
            apiName = apiProduct.getId().getName();
            apiContext = apiProduct.getContext();
            apiType = apiProduct.getType();
            apiVersion = apiProduct.getId().getVersion();
            currentStatus = apiProduct.getState();
            uuid = apiProduct.getUuid();
            apiOrApiProductId = apiMgtDAO.getAPIProductId(apiTypeWrapper.getApiProduct().getId());
            workflowType = WorkflowConstants.WF_TYPE_AM_API_PRODUCT_STATE;
        } else {
            API api = apiTypeWrapper.getApi();
            providerName = api.getId().getProviderName();
            apiName = api.getId().getApiName();
            apiContext = api.getContext();
            apiType = api.getType();
            apiVersion = api.getId().getVersion();
            currentStatus = api.getStatus();
            uuid = api.getUuid();
            apiOrApiProductId = apiMgtDAO.getAPIID(uuid);
            workflowType = WorkflowConstants.WF_TYPE_AM_API_STATE;
        }
        String gatewayVendor = apiMgtDAO.getGatewayVendorByAPIUUID(uuid);
        WorkflowStatus apiWFState = null;
        WorkflowDTO wfDTO = apiMgtDAO.retrieveWorkflowFromInternalReference(Integer.toString(apiOrApiProductId), workflowType);
        if (wfDTO != null) {
            apiWFState = wfDTO.getStatus();
        }
        // if the workflow has started, then executor should not fire again
        if (!WorkflowStatus.CREATED.equals(apiWFState)) {
            response = executeStateChangeWorkflow(currentStatus, action, apiName, apiContext, apiType, apiVersion, providerName, apiOrApiProductId, uuid, gatewayVendor, workflowType);
            // get the workflow state once the executor is executed.
            wfDTO = apiMgtDAO.retrieveWorkflowFromInternalReference(Integer.toString(apiOrApiProductId), workflowType);
            if (wfDTO != null) {
                apiWFState = wfDTO.getStatus();
                response.setStateChangeStatus(apiWFState.toString());
            } else {
                response.setStateChangeStatus(WorkflowStatus.APPROVED.toString());
            }
        }
        // apiWFState is null when simple wf executor is used because wf state is not stored in the db.
        if (WorkflowStatus.APPROVED.equals(apiWFState) || apiWFState == null) {
            targetStatus = LCManagerFactory.getInstance().getLCManager().getStateForTransition(action);
            apiPersistenceInstance.changeAPILifeCycle(new Organization(orgId), uuid, targetStatus);
            sendLCStateChangeNotification(apiName, apiType, apiContext, apiVersion, targetStatus, providerName, apiOrApiProductId, uuid);
            if (!isApiProduct) {
                API api = apiTypeWrapper.getApi();
                api.setOrganization(orgId);
                changeLifeCycle(api, currentStatus, targetStatus, checklist);
                // Sending Notifications to existing subscribers
                if (APIConstants.PUBLISHED.equals(targetStatus)) {
                    sendEmailNotification(api);
                }
            } else {
                APIProduct apiProduct = apiTypeWrapper.getApiProduct();
                apiProduct.setOrganization(orgId);
                changeLifecycle(apiProduct, currentStatus, targetStatus);
            }
            addLCStateChangeInDatabase(currentStatus, targetStatus, uuid);
            if (log.isDebugEnabled()) {
                String logMessage = "LC Status changed successfully for artifact with name: " + apiName + ", version " + apiVersion + ", New Status : " + targetStatus;
                log.debug(logMessage);
            }
            extractRecommendationDetails(apiTypeWrapper);
            return response;
        }
    } catch (APIPersistenceException e) {
        handleException("Error while accessing persistence layer", e);
    } catch (PersistenceException e) {
        handleException("Error while accessing lifecycle information ", e);
    } finally {
        PrivilegedCarbonContext.endTenantFlow();
    }
    return response;
}
Also used : PublisherAPIProduct(org.wso2.carbon.apimgt.persistence.dto.PublisherAPIProduct) APIProduct(org.wso2.carbon.apimgt.api.model.APIProduct) WorkflowDTO(org.wso2.carbon.apimgt.impl.dto.WorkflowDTO) APIStateWorkflowDTO(org.wso2.carbon.apimgt.impl.workflow.APIStateWorkflowDTO) APIPersistenceException(org.wso2.carbon.apimgt.persistence.exceptions.APIPersistenceException) Organization(org.wso2.carbon.apimgt.persistence.dto.Organization) APIStateChangeResponse(org.wso2.carbon.apimgt.api.model.APIStateChangeResponse) APIPersistenceException(org.wso2.carbon.apimgt.persistence.exceptions.APIPersistenceException) GraphQLPersistenceException(org.wso2.carbon.apimgt.persistence.exceptions.GraphQLPersistenceException) MediationPolicyPersistenceException(org.wso2.carbon.apimgt.persistence.exceptions.MediationPolicyPersistenceException) WSDLPersistenceException(org.wso2.carbon.apimgt.persistence.exceptions.WSDLPersistenceException) DocumentationPersistenceException(org.wso2.carbon.apimgt.persistence.exceptions.DocumentationPersistenceException) PersistenceException(org.wso2.carbon.apimgt.persistence.exceptions.PersistenceException) ThumbnailPersistenceException(org.wso2.carbon.apimgt.persistence.exceptions.ThumbnailPersistenceException) OASPersistenceException(org.wso2.carbon.apimgt.persistence.exceptions.OASPersistenceException) AsyncSpecPersistenceException(org.wso2.carbon.apimgt.persistence.exceptions.AsyncSpecPersistenceException) API(org.wso2.carbon.apimgt.api.model.API) ImportExportAPI(org.wso2.carbon.apimgt.impl.importexport.ImportExportAPI) SubscribedAPI(org.wso2.carbon.apimgt.api.model.SubscribedAPI) PublisherAPI(org.wso2.carbon.apimgt.persistence.dto.PublisherAPI) WorkflowStatus(org.wso2.carbon.apimgt.impl.workflow.WorkflowStatus)

Example 92 with WorkflowDTO

use of org.wso2.carbon.apimgt.impl.dto.WorkflowDTO in project carbon-apimgt by wso2.

the class APIProviderImpl method changeLifeCycleStatus.

public APIStateChangeResponse changeLifeCycleStatus(APIIdentifier apiIdentifier, String action, String organization) throws APIManagementException, FaultGatewaysException {
    APIStateChangeResponse response = new APIStateChangeResponse();
    try {
        PrivilegedCarbonContext.startTenantFlow();
        PrivilegedCarbonContext.getThreadLocalCarbonContext().setUsername(this.username);
        PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantDomain(this.tenantDomain, true);
        GenericArtifact apiArtifact = getAPIArtifact(apiIdentifier);
        String targetStatus;
        if (apiArtifact != null) {
            String providerName = apiArtifact.getAttribute(APIConstants.API_OVERVIEW_PROVIDER);
            String apiName = apiArtifact.getAttribute(APIConstants.API_OVERVIEW_NAME);
            String apiContext = apiArtifact.getAttribute(APIConstants.API_OVERVIEW_CONTEXT);
            String apiType = apiArtifact.getAttribute(APIConstants.API_OVERVIEW_TYPE);
            String apiVersion = apiArtifact.getAttribute(APIConstants.API_OVERVIEW_VERSION);
            String currentStatus = apiArtifact.getLifecycleState();
            String uuid = apiMgtDAO.getUUIDFromIdentifier(apiIdentifier, organization);
            String gatewayVendor = apiMgtDAO.getGatewayVendorByAPIUUID(uuid);
            int apiId = apiMgtDAO.getAPIID(uuid);
            WorkflowStatus apiWFState = null;
            WorkflowDTO wfDTO = apiMgtDAO.retrieveWorkflowFromInternalReference(Integer.toString(apiId), WorkflowConstants.WF_TYPE_AM_API_STATE);
            if (wfDTO != null) {
                apiWFState = wfDTO.getStatus();
            }
            // if the workflow has started, then executor should not fire again
            if (!WorkflowStatus.CREATED.equals(apiWFState)) {
                try {
                    WorkflowProperties workflowProperties = getAPIManagerConfiguration().getWorkflowProperties();
                    WorkflowExecutor apiStateWFExecutor = WorkflowExecutorFactory.getInstance().getWorkflowExecutor(WorkflowConstants.WF_TYPE_AM_API_STATE);
                    APIStateWorkflowDTO apiStateWorkflow = new APIStateWorkflowDTO();
                    apiStateWorkflow.setApiCurrentState(currentStatus);
                    apiStateWorkflow.setApiLCAction(action);
                    apiStateWorkflow.setApiName(apiName);
                    apiStateWorkflow.setApiContext(apiContext);
                    apiStateWorkflow.setApiType(apiType);
                    apiStateWorkflow.setApiVersion(apiVersion);
                    apiStateWorkflow.setApiProvider(providerName);
                    apiStateWorkflow.setGatewayVendor(gatewayVendor);
                    apiStateWorkflow.setCallbackUrl(workflowProperties.getWorkflowCallbackAPI());
                    apiStateWorkflow.setExternalWorkflowReference(apiStateWFExecutor.generateUUID());
                    apiStateWorkflow.setTenantId(tenantId);
                    apiStateWorkflow.setTenantDomain(this.tenantDomain);
                    apiStateWorkflow.setWorkflowType(WorkflowConstants.WF_TYPE_AM_API_STATE);
                    apiStateWorkflow.setStatus(WorkflowStatus.CREATED);
                    apiStateWorkflow.setCreatedTime(System.currentTimeMillis());
                    apiStateWorkflow.setWorkflowReference(Integer.toString(apiId));
                    apiStateWorkflow.setInvoker(this.username);
                    apiStateWorkflow.setApiUUID(uuid);
                    String workflowDescription = "Pending lifecycle state change action: " + action;
                    apiStateWorkflow.setWorkflowDescription(workflowDescription);
                    WorkflowResponse workflowResponse = apiStateWFExecutor.execute(apiStateWorkflow);
                    response.setWorkflowResponse(workflowResponse);
                } catch (WorkflowException e) {
                    handleException("Failed to execute workflow for life cycle status change : " + e.getMessage(), e);
                }
                // get the workflow state once the executor is executed.
                wfDTO = apiMgtDAO.retrieveWorkflowFromInternalReference(Integer.toString(apiId), WorkflowConstants.WF_TYPE_AM_API_STATE);
                if (wfDTO != null) {
                    apiWFState = wfDTO.getStatus();
                    response.setStateChangeStatus(apiWFState.toString());
                } else {
                    response.setStateChangeStatus(WorkflowStatus.APPROVED.toString());
                }
            }
            // apiWFState is null when simple wf executor is used because wf state is not stored in the db.
            if (WorkflowStatus.APPROVED.equals(apiWFState) || apiWFState == null) {
                targetStatus = "";
                apiArtifact.invokeAction(action, APIConstants.API_LIFE_CYCLE);
                targetStatus = apiArtifact.getLifecycleState();
                if (!currentStatus.equals(targetStatus)) {
                    apiMgtDAO.recordAPILifeCycleEvent(apiId, currentStatus.toUpperCase(), targetStatus.toUpperCase(), this.username, this.tenantId);
                }
                if (log.isDebugEnabled()) {
                    String logMessage = "API Status changed successfully. API Name: " + apiIdentifier.getApiName() + ", API Version " + apiIdentifier.getVersion() + ", New Status : " + targetStatus;
                    log.debug(logMessage);
                }
                APIEvent apiEvent = new APIEvent(UUID.randomUUID().toString(), System.currentTimeMillis(), APIConstants.EventType.API_LIFECYCLE_CHANGE.name(), tenantId, tenantDomain, apiName, apiId, uuid, apiVersion, apiType, apiContext, providerName, targetStatus);
                APIUtil.sendNotification(apiEvent, APIConstants.NotifierType.API.name());
                return response;
            }
        }
    } catch (GovernanceException e) {
        String cause = e.getCause().getMessage();
        if (!StringUtils.isEmpty(cause)) {
            if (cause.contains("FaultGatewaysException:")) {
                Map<String, Map<String, String>> faultMap = new HashMap<String, Map<String, String>>();
                String faultJsonString;
                if (!StringUtils.isEmpty(cause) && cause.split("FaultGatewaysException:").length > 1) {
                    faultJsonString = cause.split("FaultGatewaysException:")[1];
                    try {
                        JSONObject faultGatewayJson = (JSONObject) new JSONParser().parse(faultJsonString);
                        faultMap.putAll(faultGatewayJson);
                        throw new FaultGatewaysException(faultMap);
                    } catch (ParseException e1) {
                        log.error("Couldn't parse the Failed Environment json", e);
                        handleException("Couldn't parse the Failed Environment json : " + e.getMessage(), e);
                    }
                }
            } else if (cause.contains("APIManagementException:")) {
                // This exception already logged from APIExecutor class hence this no need to logged again
                handleException("Failed to change the life cycle status : " + cause.split("APIManagementException:")[1], e);
            } else {
                /* This exception already logged from APIExecutor class hence this no need to logged again
                    This block handles the all the exception which not have custom cause message*/
                handleException("Failed to change the life cycle status : " + e.getMessage(), e);
            }
        }
        return response;
    } finally {
        PrivilegedCarbonContext.endTenantFlow();
    }
    return response;
}
Also used : GenericArtifact(org.wso2.carbon.governance.api.generic.dataobjects.GenericArtifact) WorkflowDTO(org.wso2.carbon.apimgt.impl.dto.WorkflowDTO) APIStateWorkflowDTO(org.wso2.carbon.apimgt.impl.workflow.APIStateWorkflowDTO) WorkflowException(org.wso2.carbon.apimgt.impl.workflow.WorkflowException) APIStateWorkflowDTO(org.wso2.carbon.apimgt.impl.workflow.APIStateWorkflowDTO) FaultGatewaysException(org.wso2.carbon.apimgt.api.FaultGatewaysException) GovernanceException(org.wso2.carbon.governance.api.exception.GovernanceException) WorkflowProperties(org.wso2.carbon.apimgt.impl.dto.WorkflowProperties) WorkflowStatus(org.wso2.carbon.apimgt.impl.workflow.WorkflowStatus) APIEvent(org.wso2.carbon.apimgt.impl.notifier.events.APIEvent) JSONObject(org.json.simple.JSONObject) APIStateChangeResponse(org.wso2.carbon.apimgt.api.model.APIStateChangeResponse) WorkflowResponse(org.wso2.carbon.apimgt.api.WorkflowResponse) WorkflowExecutor(org.wso2.carbon.apimgt.impl.workflow.WorkflowExecutor) JSONParser(org.json.simple.parser.JSONParser) ParseException(org.json.simple.parser.ParseException) Map(java.util.Map) TreeMap(java.util.TreeMap) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) HashMap(java.util.HashMap)

Example 93 with WorkflowDTO

use of org.wso2.carbon.apimgt.impl.dto.WorkflowDTO in project carbon-apimgt by wso2.

the class AbstractAPIManager method getAPIbyUUID.

/**
 * Get API by registry artifact id
 *
 * @param uuid         Registry artifact id
 * @param organization organization for the registry
 * @return API of the provided artifact id
 * @throws APIManagementException
 */
public API getAPIbyUUID(String uuid, String organization) throws APIManagementException {
    boolean tenantFlowStarted = false;
    try {
        Registry registry;
        if (organization != null && !MultitenantConstants.SUPER_TENANT_DOMAIN_NAME.equals(organization)) {
            int id = getTenantManager().getTenantId(organization);
            startTenantFlow(organization);
            tenantFlowStarted = true;
            registry = getRegistryService().getGovernanceSystemRegistry(id);
        } else {
            if (this.tenantDomain != null && !MultitenantConstants.SUPER_TENANT_DOMAIN_NAME.equals(this.tenantDomain)) {
                // at this point, requested tenant = carbon.super but logged in user is anonymous or tenant
                registry = getRegistryService().getGovernanceSystemRegistry(MultitenantConstants.SUPER_TENANT_ID);
            } else {
                // both requested tenant and logged in user's tenant are carbon.super
                registry = this.registry;
            }
        }
        GenericArtifactManager artifactManager = getAPIGenericArtifactManagerFromUtil(registry, APIConstants.API_KEY);
        GenericArtifact apiArtifact = artifactManager.getGenericArtifact(uuid);
        if (apiArtifact != null) {
            API api = getApiForPublishing(registry, apiArtifact);
            WorkflowDTO workflowDTO = APIUtil.getAPIWorkflowStatus(api.getUuid(), WF_TYPE_AM_API_STATE);
            if (workflowDTO != null) {
                WorkflowStatus status = workflowDTO.getStatus();
                api.setWorkflowStatus(status.toString());
            }
            return api;
        } else {
            String msg = "Failed to get API. API artifact corresponding to artifactId " + uuid + " does not exist";
            throw new APIMgtResourceNotFoundException(msg);
        }
    } catch (RegistryException e) {
        String msg = "Failed to get API";
        throw new APIManagementException(msg, e);
    } catch (org.wso2.carbon.user.api.UserStoreException e) {
        String msg = "Failed to get API";
        throw new APIManagementException(msg, e);
    } finally {
        if (tenantFlowStarted) {
            endTenantFlow();
        }
    }
}
Also used : GenericArtifact(org.wso2.carbon.governance.api.generic.dataobjects.GenericArtifact) WorkflowDTO(org.wso2.carbon.apimgt.impl.dto.WorkflowDTO) GenericArtifactManager(org.wso2.carbon.governance.api.generic.GenericArtifactManager) UserRegistry(org.wso2.carbon.registry.core.session.UserRegistry) Registry(org.wso2.carbon.registry.core.Registry) APIMgtResourceNotFoundException(org.wso2.carbon.apimgt.api.APIMgtResourceNotFoundException) RegistryException(org.wso2.carbon.registry.core.exceptions.RegistryException) WorkflowStatus(org.wso2.carbon.apimgt.impl.workflow.WorkflowStatus) APIManagementException(org.wso2.carbon.apimgt.api.APIManagementException) SubscribedAPI(org.wso2.carbon.apimgt.api.model.SubscribedAPI) PublisherAPI(org.wso2.carbon.apimgt.persistence.dto.PublisherAPI) API(org.wso2.carbon.apimgt.api.model.API)

Example 94 with WorkflowDTO

use of org.wso2.carbon.apimgt.impl.dto.WorkflowDTO in project carbon-apimgt by wso2.

the class UserSignUpSimpleWorkflowExecutor method complete.

@Override
public WorkflowResponse complete(WorkflowDTO workflowDTO) throws WorkflowException {
    if (log.isDebugEnabled()) {
        log.debug("User Sign Up [Complete] Workflow Invoked. Workflow ID : " + workflowDTO.getExternalWorkflowReference() + "Workflow State : " + workflowDTO.getStatus());
    }
    String tenantDomain = workflowDTO.getTenantDomain();
    try {
        UserRegistrationConfigDTO signupConfig = SelfSignUpUtil.getSignupConfiguration(tenantDomain);
        String tenantAwareUserName = MultitenantUtils.getTenantAwareUsername(workflowDTO.getWorkflowReference());
        updateRolesOfUser(tenantAwareUserName, SelfSignUpUtil.getRoleNames(signupConfig), tenantDomain);
    } catch (APIManagementException e) {
        throw new WorkflowException("Error while accessing signup configuration", e);
    } catch (Exception e) {
        throw new WorkflowException("Error while assigning role to user", e);
    }
    return new GeneralWorkflowResponse();
}
Also used : APIManagementException(org.wso2.carbon.apimgt.api.APIManagementException) UserRegistrationConfigDTO(org.wso2.carbon.apimgt.impl.dto.UserRegistrationConfigDTO) APIManagementException(org.wso2.carbon.apimgt.api.APIManagementException)

Example 95 with WorkflowDTO

use of org.wso2.carbon.apimgt.impl.dto.WorkflowDTO in project carbon-apimgt by wso2.

the class APIStateChangeWSWorkflowExecutor method execute.

@Override
public WorkflowResponse execute(WorkflowDTO workflowDTO) throws WorkflowException {
    if (log.isDebugEnabled()) {
        log.debug("Executing API State change Workflow.");
        log.debug("Execute workflowDTO " + workflowDTO.toString());
    }
    if (stateList != null) {
        Map<String, List<String>> stateActionMap = getSelectedStatesToApprove();
        APIStateWorkflowDTO apiStateWorkFlowDTO = (APIStateWorkflowDTO) workflowDTO;
        if (stateActionMap.containsKey(apiStateWorkFlowDTO.getApiCurrentState().toUpperCase()) && stateActionMap.get(apiStateWorkFlowDTO.getApiCurrentState().toUpperCase()).contains(apiStateWorkFlowDTO.getApiLCAction())) {
            // set the auth application related info. This will be used to call the callback service
            setOAuthApplicationInfo(apiStateWorkFlowDTO);
            // build request payload
            String jsonPayload = buildPayloadForBPMNProcess(apiStateWorkFlowDTO);
            if (log.isDebugEnabled()) {
                log.debug("APIStateChange payload: " + jsonPayload);
            }
            if (serviceEndpoint == null) {
                // set the bps endpoint from the global configurations
                WorkflowProperties workflowProperties = ServiceReferenceHolder.getInstance().getAPIManagerConfigurationService().getAPIManagerConfiguration().getWorkflowProperties();
                serviceEndpoint = workflowProperties.getServerUrl();
            }
            URL serviceEndpointURL = new URL(serviceEndpoint);
            HttpClient httpClient = APIUtil.getHttpClient(serviceEndpointURL.getPort(), serviceEndpointURL.getProtocol());
            HttpPost httpPost = new HttpPost(serviceEndpoint + RUNTIME_INSTANCE_RESOURCE_PATH);
            // Generate the basic auth header using provided user credentials
            String authHeader = getBasicAuthHeader();
            httpPost.setHeader(HttpHeaders.AUTHORIZATION, authHeader);
            StringEntity requestEntity = new StringEntity(jsonPayload, ContentType.APPLICATION_JSON);
            httpPost.setEntity(requestEntity);
            try {
                HttpResponse response = httpClient.execute(httpPost);
                if (response.getStatusLine().getStatusCode() != HttpStatus.SC_CREATED) {
                    String error = "Error while starting the process:  " + response.getStatusLine().getStatusCode() + " " + response.getStatusLine().getReasonPhrase();
                    log.error(error);
                    throw new WorkflowException(error);
                }
            } catch (ClientProtocolException e) {
                String errorMsg = "Error while creating the http client";
                log.error(errorMsg, e);
                throw new WorkflowException(errorMsg, e);
            } catch (IOException e) {
                String errorMsg = "Error while connecting to the BPMN process server from the WorkflowExecutor.";
                log.error(errorMsg, e);
                throw new WorkflowException(errorMsg, e);
            } finally {
                httpPost.reset();
            }
            super.execute(workflowDTO);
        } else {
            // For any other states, act as simpleworkflow executor.
            workflowDTO.setStatus(WorkflowStatus.APPROVED);
            // calling super.complete() instead of complete() to act as the simpleworkflow executor
            super.complete(workflowDTO);
        }
    } else {
        String msg = "State change list is not provided. Please check <stateList> element in ";
        log.error(msg);
        throw new WorkflowException(msg);
    }
    return new GeneralWorkflowResponse();
}
Also used : HttpPost(org.apache.http.client.methods.HttpPost) HttpResponse(org.apache.http.HttpResponse) IOException(java.io.IOException) WorkflowProperties(org.wso2.carbon.apimgt.impl.dto.WorkflowProperties) URL(org.apache.axis2.util.URL) ClientProtocolException(org.apache.http.client.ClientProtocolException) StringEntity(org.apache.http.entity.StringEntity) HttpClient(org.apache.http.client.HttpClient) ArrayList(java.util.ArrayList) List(java.util.List)

Aggregations

Test (org.junit.Test)51 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)51 WorkflowDTO (org.wso2.carbon.apimgt.impl.dto.WorkflowDTO)49 APIManagementException (org.wso2.carbon.apimgt.api.APIManagementException)46 ApplicationWorkflowDTO (org.wso2.carbon.apimgt.impl.dto.ApplicationWorkflowDTO)33 SubscriptionWorkflowDTO (org.wso2.carbon.apimgt.impl.dto.SubscriptionWorkflowDTO)31 Application (org.wso2.carbon.apimgt.api.model.Application)25 ApiMgtDAO (org.wso2.carbon.apimgt.impl.dao.ApiMgtDAO)22 ApplicationRegistrationWorkflowDTO (org.wso2.carbon.apimgt.impl.dto.ApplicationRegistrationWorkflowDTO)19 ServiceReferenceHolderMockCreator (org.wso2.carbon.apimgt.impl.ServiceReferenceHolderMockCreator)17 WorkflowExecutor (org.wso2.carbon.apimgt.impl.workflow.WorkflowExecutor)14 Subscriber (org.wso2.carbon.apimgt.api.model.Subscriber)11 XMLStreamException (javax.xml.stream.XMLStreamException)10 JSONObject (org.json.simple.JSONObject)10 APIIdentifier (org.wso2.carbon.apimgt.api.model.APIIdentifier)10 WorkflowException (org.wso2.carbon.apimgt.impl.workflow.WorkflowException)10 HashMap (java.util.HashMap)9 UserRegistrationConfigDTO (org.wso2.carbon.apimgt.impl.dto.UserRegistrationConfigDTO)9 ServiceClient (org.apache.axis2.client.ServiceClient)7 SubscribedAPI (org.wso2.carbon.apimgt.api.model.SubscribedAPI)7