This blog is the fourth in the FlexDeploy Loves OIC blog series, stay tuned for subsequent entries in the series.
- FlexDeploy Loves OIC: Series Overview
- FlexDeploy Loves OIC: Manage integrations with connections
- FlexDeploy Loves OIC: Manage connection property replacement
- FlexDeploy Loves OIC: Continuous Integration
- FlexDeploy Loves OIC: Automated testing
- FlexDeploy Loves OIC: Continuous Delivery with Pipelines and Releases
- FlexDeploy Loves OIC: Manage connections, lookups and libraries
Oracle Integration Cloud (OIC) provides the ability to develop an integration in the cloud. The integration can connect cloud and/or on-premise applications. Now that we have setup Continuous Integration with OIC, it is time to add automated testing to the process.
I will walk you through the test automation framework support that FlexDeploy provides for automated testing. We will execute a test using the Postman testing tool, as FlexDeploy facilitates the execution and not the building of tests. There are several other testing tools that are available out of box with FlexDeploy, such as SOAPUI, Junit, TestNG and JMeter.
We will add a test that was built in Postman to the PROCESS_HR_REQUEST project that was created in the Manage Integrations with Connections blog. However, the first component that we need to create is a test instance that will provide Postman properties and an endpoint to communicate with the Postman installation. Select Topology -> Integrations, then select the Testing tab. Click the Plus (+) button in the upper right-hand corner to create a new instance and configure as follows:
- Instance Code – add POSTMAN (internal code)
- Instance Name – add Postman (display name)
- Testing Tool – select Postman from the dropdown
- Newman Executable Path – path to the executable for the Postman installation
- Save the instance
Click on the Environments tab and drag the appropriate environments from the right palette to the center palette. This will provide the environments where the test could be executed. Click Save.
Click on the Postman instance and change to the Environment tab, we need to configure the appropriate endpoints for the Postman installation. Click on the Endpoints link for each of the environments and drag the appropriate Endpoint from the right palette to the center palette. Save after all configuration is complete. If there are any additional properties that need to be configured, they can be done by clicking on the Properties link (there are no extra properties needed for this instance).
Now we can configure the project with a test strategy. Open up the PROCESS_HR_REQUEST (FlexDeploy/HR OIC) project and select the Test Automation tab (second from bottom). A test strategy provides the ability to configure different tests for different environment/instance combinations. We will configure a Smoke Tests test type for the Development environment and the OIC instance. The strategy will look like the following:
Now we can setup a test set that contains one to many test definitions. Click on the Test Sets tab and click Create. Configure the Test Set as follows:
Click on Next to configure the Test Set Qualifier by selecting a qualifier from the dropdown. In this case, we select “Number of Test Definitions PASSED greater than” and a value of zero. This means that all Test Definitions must pass for the overall Test Set to pass. Save the configuration.
Click on the test set (Smoke Test) link and create a Test Definition that will be for each test that needs to be run. Configure the Test Definition as follows:
Now we need to configure the test workflow to run for a Postman collection of tests. There are many out of box testing workflows such as Postman-runCollection, so we just need to select it from the dropdown. Once we select the Postman-runCollection workflow, a list of properties will display. We just need to configure where the test collection is saved, which is generally on the Postman installation server.
Click Next through the next screen, unless you want this test definition to run a different workflow than the default one just configured.
Click on Next to configure the Test Case Qualifier by selecting a qualifier from the drop down. In this case, we select “Number of Test Cases PASSED greater than” and a value of zero. This means that all Test Cases must pass for the overall Test Definition to pass. Save the configuration.
We now have a test case configured through Postman that can be run against the Development environment. If you want additional strategies for other environments, they can be configured in the same manner.
There are several ways to execute a test on a project; 1) independently execute a test from the project execution screen, 2) add an InvokeTest workflow operation in the deployment workflow or 3) add a test step to a release/pipeline.
We will execute option 1 for this blog and then show option 3 in the next blog in the series regarding release automation. I am not showing option 2 in the blog series as it will simply perform the same operations as option 1 and we would remove it in the next blog. Below is an initial image of integration instances for the Process HR Request integration flow in OIC.
Open up the PROCESS_HR_REQUEST project and click on the Test button in the upper right-hand corner on the execution tab. A Run Tests Request Form will be displayed and allow you to select the environment and instance that will match against the Test Strategy. The tests are run when the strategy is matched. Leaving the last three inputs blank will run all configured tests or a specific test(s) can be requested.
Submitting the request will execute the configured tests and the execution screen will look as follows:
Clicking on the Execution Id will show the Validate Service was executed in the Execution Steps tab and that the test was successful.
Click on the Test Results tab and a summary of all tests executed will be displayed so we can see what passed/failed.
Since we ran the test and that required the integration to execute, here is the latest integration instance screen in OIC after the test execution that shows that an integration instance was created.
This was the fourth blog for the FlexDeploy Loves OIC series and covered how to configure FlexDeploy for test automation of the OIC integration created in the Manage Integrations with Connections blog and how tests can be executed through FlexDeploy. In the next blog in the series, the test automation capability just created will be utilized when we add Release Automation to the process. Release Automation provides the ability to manage deployments across environments.
Previous Post: FlexDeploy Loves OIC: Continuous Integration