Search in sources :

Example 11 with WorkflowResponseDTO

use of org.wso2.carbon.apimgt.rest.api.publisher.dto.WorkflowResponseDTO in project carbon-apimgt by wso2.

the class MiscMappingUtilTestCase method testFromWorkflowResponseToDTO.

@Test
public void testFromWorkflowResponseToDTO() {
    WorkflowResponse workflowResponse = new GeneralWorkflowResponse();
    workflowResponse.setWorkflowStatus(WorkflowStatus.APPROVED);
    WorkflowResponseDTO workflowResponseDTO = MiscMappingUtil.fromWorkflowResponseToDTO(workflowResponse);
    assertEquals(workflowResponseDTO.getWorkflowStatus().name(), workflowResponse.getWorkflowStatus().name());
}
Also used : WorkflowResponseDTO(org.wso2.carbon.apimgt.rest.api.store.dto.WorkflowResponseDTO) GeneralWorkflowResponse(org.wso2.carbon.apimgt.core.workflow.GeneralWorkflowResponse) GeneralWorkflowResponse(org.wso2.carbon.apimgt.core.workflow.GeneralWorkflowResponse) WorkflowResponse(org.wso2.carbon.apimgt.core.api.WorkflowResponse) Test(org.testng.annotations.Test)

Example 12 with WorkflowResponseDTO

use of org.wso2.carbon.apimgt.rest.api.publisher.dto.WorkflowResponseDTO in project carbon-apimgt by wso2.

the class TestMappingUtilTestCase method testWorkflowResponseToWorkflowResponseDTOMapping.

@Test(description = "Workflow response to Workflow response DTO mapping ")
void testWorkflowResponseToWorkflowResponseDTOMapping() {
    WorkflowResponse workflowResponse = new GeneralWorkflowResponse();
    workflowResponse.setWorkflowStatus(WorkflowStatus.APPROVED);
    WorkflowResponseDTO workflowResponseDTO = MappingUtil.toWorkflowResponseDTO(workflowResponse);
    assertEquals(workflowResponse.getWorkflowStatus().name(), workflowResponseDTO.getWorkflowStatus().name());
}
Also used : WorkflowResponseDTO(org.wso2.carbon.apimgt.rest.api.publisher.dto.WorkflowResponseDTO) GeneralWorkflowResponse(org.wso2.carbon.apimgt.core.workflow.GeneralWorkflowResponse) WorkflowResponse(org.wso2.carbon.apimgt.core.api.WorkflowResponse) GeneralWorkflowResponse(org.wso2.carbon.apimgt.core.workflow.GeneralWorkflowResponse) Test(org.testng.annotations.Test)

Aggregations

WorkflowResponse (org.wso2.carbon.apimgt.core.api.WorkflowResponse)6 HashMap (java.util.HashMap)5 APIManagementException (org.wso2.carbon.apimgt.core.exception.APIManagementException)5 ErrorDTO (org.wso2.carbon.apimgt.rest.api.common.dto.ErrorDTO)5 WorkflowResponseDTO (org.wso2.carbon.apimgt.rest.api.store.dto.WorkflowResponseDTO)5 URI (java.net.URI)4 URISyntaxException (java.net.URISyntaxException)4 Map (java.util.Map)4 ErrorHandler (org.wso2.carbon.apimgt.core.exception.ErrorHandler)4 GeneralWorkflowResponse (org.wso2.carbon.apimgt.core.workflow.GeneralWorkflowResponse)4 Test (org.testng.annotations.Test)3 APIStore (org.wso2.carbon.apimgt.core.api.APIStore)3 Application (org.wso2.carbon.apimgt.core.models.Application)3 WorkflowResponseDTO (org.wso2.carbon.apimgt.rest.api.publisher.dto.WorkflowResponseDTO)3 APIMgtResourceNotFoundException (org.wso2.carbon.apimgt.core.exception.APIMgtResourceNotFoundException)2 ExceptionCodes (org.wso2.carbon.apimgt.core.exception.ExceptionCodes)2 WorkflowResponseDTO (org.wso2.carbon.apimgt.rest.api.admin.dto.WorkflowResponseDTO)2 ApplicationDTO (org.wso2.carbon.apimgt.rest.api.store.dto.ApplicationDTO)2 StringTokenizer (java.util.StringTokenizer)1 APIMgtAdminService (org.wso2.carbon.apimgt.core.api.APIMgtAdminService)1