cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

JTest hijacks URLConnection so it is impossible to build integration tests

rpatrick00
Contributor

I was very hopeful that I could use the SnapLogic JTest framework to build actual integration tests for my custom snap pack. Unfortunately, JTest is mocking the URLConnection in such a way where my custom snapsโ€™ SOAP calls are failing. Sighโ€ฆ

[ERROR] getUserID_ReturnsExpectedValue(com.tylertech.courtsandjustice.snaplogic.OdysseyApiExecutionSyncXmlTest) Time elapsed: 0.059 s <<< ERROR!
com.snaplogic.api.ConfigurationException:
Getting Odyssey Release Level from Odyssey Site QA-2018-2-MEREADY failed: Failed to call SOAP service: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Message send failed
com.snaplogic.api.ExecutionException: Failed to call SOAP service: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Message send failed
at com.tylertech.courtsandjustice.snaplogic.OdysseyApiExecutionSyncXmlTest.getUserID_ReturnsExpectedValue(OdysseyApiExecutionSyncXmlTest.java:33)
Caused by: com.snaplogic.api.ExecutionException: Failed to call SOAP service: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Message send failed
at com.tylertech.courtsandjustice.snaplogic.OdysseyApiExecutionSyncXmlTest.getUserID_ReturnsExpectedValue(OdysseyApiExecutionSyncXmlTest.java:33)
Caused by: com.sun.xml.messaging.saaj.SOAPExceptionImpl: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Message send failed
at com.tylertech.courtsandjustice.snaplogic.OdysseyApiExecutionSyncXmlTest.getUserID_ReturnsExpectedValue(OdysseyApiExecutionSyncXmlTest.java:33)
Caused by: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Message send failed
at com.tylertech.courtsandjustice.snaplogic.OdysseyApiExecutionSyncXmlTest.getUserID_ReturnsExpectedValue(OdysseyApiExecutionSyncXmlTest.java:33)
Caused by: java.lang.ClassCastException: com.snaplogic.snap.test.harness.UrlStreamFactoryImpl$MockUrlConnection cannot be cast to java.net.HttpURLConnection
at com.tylertech.courtsandjustice.snaplogic.OdysseyApiExecutionSyncXmlTest.getUserID_ReturnsExpectedValue(OdysseyApiExecutionSyncXmlTest.java:33)

1 REPLY 1

karunakerreddyv
Former Employee

getting same error but no one responded still.

 

class com.snaplogic.snap.test.harness.UrlStreamFactoryImpl$MockUrlConnection cannot be cast to class javax.net.ssl.HttpsURLConnection (com.snaplogic.snap.test.harness.UrlStreamFactoryImpl$MockUrlConnection is in unnamed module of loader 'app'; javax.net.ssl.HttpsURLConnection is in module java.base of loader 'bootstrap')