May 17, 2020

Testing of Basic Error Handling in OIC


In this blog we will test the Integration which we have developed in previous blog

Prerequisite : SoapUI Tool


Lets see the testing steps in detail :
  • Activate the Integration and open the URL which get generated after integration activation.
  • Copy the Endpoint URL 
  • Open SoapUI Tool and create a REST Project. Paste the copied Endpoint URL. 
  • Select Method = Post and Media Type =application/xml and then click 🔓 Auth to add basic Authorization
  • Select Add New Authorization and select Type = Basic and then click Ok.

  • Enter your OIC Instance User Id and Password in Username and Password box respectively. 
  • Now Download the Request Payload from below link and paste the same in SoapUI Request Box
         Download Input XML


  • Hit the Run button and you will see the respective Output in right side response window.
          [ See the below testing window for your reference ]

We have tested the Integration successfully. It is working as of our usecase.

Now lets check our Error Handling Scenario. We will intentionally made the Service to get Error Out by passing some random data as Input and then check whether the Error Handling is working properly or not .


Lets first check "Global Fault Handler" :

  • Change the Input XML Data of Element i.e. in-place of "64" pass XYZ (a string in-place of integer)

Now Hit the Run Button. The service will get error out because "XYZ" is a        STRING   not an INTEGER. So Addition operation got failed 
i.e. XYZ + 5 = ERROR

  • Now to check where the service exactly failed, Lets see its Flow Instance in OIC. Open the OIC Instance --> Go to Monitoring Window--> select Tracking  and then open the failed Instance.
      
     Once the Flow get opened you can see the service get failed at Addition 
     Operation Execution. This error get handled by "GLOBAL FAULT HANDLER"
     because it is not inside any scope and the Flow execution will stop.

    If you click on Global Fault, you can see its flow. It handled the error and 
    sent email notification.


   Now check your email, You have got one Error Email Notification similar like 
   below 

Now lets first check "Scope Fault Handler" :

  • Change the Input XML Data of Element i.e. in-place of "4" pass XYZ (a string in-place of integer)
     *Make sure you have removed XYZ and passing some Integer as input in             element which we have configured above to test Global Fault Handler.

      (check below image for you reference)

Hit the Run Button. This time you can see output in SoapUI response window because the error handled by Scope Fault Handler and execution of Flow continues without getting stopped. 

Addition OutPut = 4+5 = 9 
Multiplication Output :
  • 1st Iteration : 41*25 = 1025
  • 2nd Iteration : XYZ*90= ERROR Out -- >handled by Scope Fault Handler -- >Move for next Iteration )
  • 3rd Iteration : 4*5=  20
Total Multiplication Value = 41*25+4*5 = 1045  (You can see the same value as multiplication    output ,check below image)

          
  • Lets see its Flow Instance in OIC. Open the OIC Instance --> Go to Monitoring Window--> select Tracking  and then open the recent Instance.
         
Now check your email, You have got one Error Email Notification from Scope Fault Handler similar like below :

That's it. I hope this blog helped you to understand basic Error Handling in OIC. 

Thank You ! & Stay Happy :)

No comments:

If you have any doubts, Please let me know.