diff --git a/components/apimgt/org.wso2.carbon.apimgt.impl/src/test/java/org/wso2/carbon/apimgt/impl/workflow/TenantWorkflowConfigHolderTest.java b/components/apimgt/org.wso2.carbon.apimgt.impl/src/test/java/org/wso2/carbon/apimgt/impl/workflow/TenantWorkflowConfigHolderTest.java index a12939d1bbd9..c78ff6d03549 100644 --- a/components/apimgt/org.wso2.carbon.apimgt.impl/src/test/java/org/wso2/carbon/apimgt/impl/workflow/TenantWorkflowConfigHolderTest.java +++ b/components/apimgt/org.wso2.carbon.apimgt.impl/src/test/java/org/wso2/carbon/apimgt/impl/workflow/TenantWorkflowConfigHolderTest.java @@ -75,6 +75,7 @@ public void testLoadingDefaultTenantWorkflowConfig() throws IOException, XMLStre Mockito.when(apimConfigService.getWorkFlowConfig(tenantDomain)).thenReturn(IOUtils.toString(defaultWFConfigContent)); try { tenantWorkflowConfigHolder.load(); + Assert.assertNotNull(tenantWorkflowConfigHolder.getWorkflowExecutor("AM_REVISION_DEPLOYMENT")); Assert.assertNotNull(tenantWorkflowConfigHolder.getWorkflowExecutor("AM_APPLICATION_CREATION")); Assert.assertNotNull(tenantWorkflowConfigHolder.getWorkflowExecutor ("AM_APPLICATION_REGISTRATION_PRODUCTION")); @@ -100,6 +101,7 @@ public void testLoadingExtendedTenantWorkflowConfig() throws IOException, XMLStr Mockito.when(apimConfigService.getWorkFlowConfig(tenantDomain)).thenReturn(IOUtils.toString(defaultWFConfigContent)); try { tenantWorkflowConfigHolder.load(); + Assert.assertNotNull(tenantWorkflowConfigHolder.getWorkflowExecutor("AM_REVISION_DEPLOYMENT")); Assert.assertNotNull(tenantWorkflowConfigHolder.getWorkflowExecutor("AM_APPLICATION_CREATION")); Assert.assertNotNull(tenantWorkflowConfigHolder.getWorkflowExecutor ("AM_APPLICATION_REGISTRATION_PRODUCTION")); @@ -131,6 +133,7 @@ public void testFailureToLoadTenantWFConfigWhenErrorWhileLoadingRegistryResource public void testFailureToLoadTenantWFConfigWhenWFExecutorClassNotFound() throws Exception { //For signup workflow we set TestUserSignUpSimpleWorkflowExecutor. since it is not there, default signup executor should be used. String invalidWFExecutor = "\n" + + " \n" + " \n" + " \n" + " \n" @@ -278,6 +281,8 @@ public void testFailureToLoadTenantWFConfigWhenWFExecutorHasMultipleParamTypes() //Workflow executor class setter methods are available for different parameter types String invalidWFExecutor = "\n" + + " \n" + " \n" + " admin\n" + diff --git a/components/apimgt/org.wso2.carbon.apimgt.impl/src/test/resources/dbscripts/h2-sample-data.sql b/components/apimgt/org.wso2.carbon.apimgt.impl/src/test/resources/dbscripts/h2-sample-data.sql index 62f02a6c02b0..9e89094260fe 100644 --- a/components/apimgt/org.wso2.carbon.apimgt.impl/src/test/resources/dbscripts/h2-sample-data.sql +++ b/components/apimgt/org.wso2.carbon.apimgt.impl/src/test/resources/dbscripts/h2-sample-data.sql @@ -58,13 +58,13 @@ INSERT INTO AM_CERTIFICATE_METADATA VALUES (1001, 'ALIAS_2','EP_2',RAWTOHEX('abc INSERT INTO AM_CERTIFICATE_METADATA VALUES (1002, 'ALIAS_3','EP_3',RAWTOHEX('abcdefghtij')); INSERT INTO AM_CERTIFICATE_METADATA VALUES (1002, 'ALIAS_4','EP_4',RAWTOHEX('abcdefghtij')); -INSERT INTO AM_WORKFLOWS VALUES (1, '821b9664-eeca-4173-9f56-3dc6d46bd6eb', 'AM_REVISION_DEPLOYMENT', 'CREATED', '2017-01-01 00:00:00', '2017-01-01 00:00:00', 'sampleDescription', 1, 'sampleDomain', '821b9664-eeca-4173-9f56-3dc6d46bd6e5', null, null); +INSERT INTO AM_WORKFLOWS (WF_ID, WF_REFERENCE, WF_TYPE, WF_STATUS, WF_CREATED_TIME, WF_UPDATED_TIME, WF_STATUS_DESC, TENANT_ID, TENANT_DOMAIN, WF_EXTERNAL_REFERENCE, WF_METADATA, WF_PROPERTIES) VALUES (5, '821b9664-eeca-4173-9f56-3dc6d46bd6eb', 'AM_REVISION_DEPLOYMENT', 'CREATED', '2017-01-01 00:00:00','2017-01-01 00:00:00', 'sampleDescription', -1234, 'sampleDomain', '821b9664-eeca-4173-9f56-3dc6d46bd6e5', null, null); -INSERT INTO AM_REVISION VALUES (5,'7af95c9d-6177-4191-ab3e-d3f6c1cdc4c2', '821b9664-eeca-4173-9f56-3dc6d46bd6eb', 'sampleDescription','2017-01-01 00:00:00', 'admin'); -INSERT INTO AM_REVISION VALUES (5,'696430b1-c554-4d82-8ea9-ea1a61db0a60', '821b9664-eeca-4173-9f56-3dc6d46bd6e3', 'sampleDescription','2017-01-01 00:00:00', 'admin'); +INSERT INTO AM_REVISION (ID, API_UUID, REVISION_UUID, DESCRIPTION, CREATED_TIME, CREATED_BY) VALUES (5, '7af95c9d-6177-4191-ab3e-d3f6c1cdc4c2', '821b9664-eeca-4173-9f56-3dc6d46bd6eb', 'sampleDescription', '2017-01-01 00:00:00', 'admin'); +INSERT INTO AM_REVISION (ID, API_UUID, REVISION_UUID, DESCRIPTION, CREATED_TIME, CREATED_BY) VALUES (5, '696430b1-c554-4d82-8ea9-ea1a61db0a60', '821b9664-eeca-4173-9f56-3dc6d46bd6e3', 'sampleDescription', '2017-01-01 00:00:00', 'admin'); -INSERT INTO AM_DEPLOYMENT_REVISION_MAPPING VALUES ('default','testVhost', '821b9664-eeca-4173-9f56-3dc6d46bd6eb', 'CREATED', TRUE, '2017-01-01 00:00:00'); -INSERT INTO AM_DEPLOYMENT_REVISION_MAPPING VALUES ('default','testVhost', '821b9664-eeca-4173-9f56-3dc6d46bd6e3', 'APPROVED', TRUE, '2017-01-01 00:00:00'); +INSERT INTO AM_DEPLOYMENT_REVISION_MAPPING (NAME, VHOST, REVISION_UUID, REVISION_STATUS, DISPLAY_ON_DEVPORTAL, DEPLOYED_TIME) VALUES ('default', 'testVhost', '821b9664-eeca-4173-9f56-3dc6d46bd6eb', 'CREATED', TRUE, '2017-01-01 00:00:00'); +INSERT INTO AM_DEPLOYMENT_REVISION_MAPPING (NAME, VHOST, REVISION_UUID, REVISION_STATUS, DISPLAY_ON_DEVPORTAL, DEPLOYED_TIME) VALUES ('default', 'testVhost', '821b9664-eeca-4173-9f56-3dc6d46bd6e3', 'APPROVED', TRUE, '2017-01-01 00:00:00'); INSERT INTO AM_POLICY_SUBSCRIPTION (NAME, DISPLAY_NAME, TENANT_ID, QUOTA_TYPE, QUOTA, UNIT_TIME, TIME_UNIT,BILLING_PLAN) VALUES ('Gold', 'Gold', -1234, 'requestCount', 2, 1, 'min', 'Free'); diff --git a/components/apimgt/org.wso2.carbon.apimgt.impl/src/test/resources/workflow-configs/default-workflow-extensions.xml b/components/apimgt/org.wso2.carbon.apimgt.impl/src/test/resources/workflow-configs/default-workflow-extensions.xml index 00228cf5331b..ce54dabc764d 100644 --- a/components/apimgt/org.wso2.carbon.apimgt.impl/src/test/resources/workflow-configs/default-workflow-extensions.xml +++ b/components/apimgt/org.wso2.carbon.apimgt.impl/src/test/resources/workflow-configs/default-workflow-extensions.xml @@ -17,6 +17,8 @@ --> + + + http://localhost:9765/services/ApplicationApprovalWorkFlowProcess/ admin