Karate test framework: besides SOAP and REST also JMS calls? [duplicate] - api

This question already has an answer here:
How can I integrate socket.io on Karate
(1 answer)
Closed 1 year ago.
We are using ReadyAPI for API testing, Mocking and JMeter for performance testing and looking into the possibility to migrate everything to Karate framework. Would be handy to have all in one open source framework. But the main question is: can Karate framework handle JMS calls? Because 80% of our service testing is via JMS (with Hermes in ReadyAPI). I know SOAP and REST are supported but can't find anything about JMS.

Yes, you have to write a Java adapter (one-time work).
Please look at these 2 references:
https://twitter.com/getkarate/status/1128170638223364097
A great example that shows off Karate's
Java / JS interop - and built-in async support
first we call custom code to listen to an ApacheActiveMQ queue
an HTTP POST is made
we wait for the JMS message
and assert that the message is as expected
https://github.com/intuit/karate/tree/master/karate-netty#consumer-provider-example
https://twitter.com/getkarate/status/1417023536082812935
How Java interop and mocks can come together for advanced async / messaging flows such as JMS or apachekafka
link to full example: https://github.com/intuit/karate/tree/develop/karate-demo/src/test/java/mock/async

Related

Using Karate, can the .feature Mock files intercept calls from back-end Java service class?

Question about Karate: can the .feature Mock files intercept calls from back-end Java service class?
I think the mocking feature is pretty easy to understand. I can see that you can start the mock server in the background step and then your scenario HTTP calls will be intercepted BUT
My question is: is it possible to intercept HTTP calls coming from my back-end service class after I hit my API endpoint with a Karate step?
If I don't get an answer, I will put together a sample project and experiment. Just hoping someone knows off-hand. If not, I think I can probably run an instance of Mountebank.
It may be possible by telling the JVM to use an HTTP proxy, but it depends a lot on the system under test.
You can find more details here: https://stackoverflow.com/a/61414022/143475

Can we use postman to test Corda api

Im a beginner in developing CorDapps, so far I have successfully written flows and such, I am currently learning how to code APIs for Corda, and I'm not sure if I could test Corda APIs in postman like regular APIs, any info would be greatly appreciated.
The Corda Webserver that you're referring to is simply a Jetty server that connects to the Corda node using the CordaRPCClient library, then provides an HTTP API that allows the webserver to map HTTP requests from users to RPC operations on the node. You can test this API in the same way as a regular server (e.g. by using Postman).
Please note that the Corda Webserver is deprecated as of Corda 3 and you are expected to create your own Java webserver mapping HTTP requests to RPC operations instead. See the Spring Webserver sample here for an example.

Is there a testing framework that will support GraphQL, web app testing, and mobile?

I have started to use Karate to test our mobile app which is using GraphQL and it is working good so far, though a bit of a learning curve for me as I am not a programmer by trade, but I need to look further into the future and be sure to find a framework that will also support our need to automate tests for our custom web applications as well. I would think Selenium would be the way to go so I am looking for a testing framework where I can test not only the GraphQL queries which our micro services/APIs are written, but also our web applications and our mobile app. We are a MS shop but if need be, as with Karate, we can venture into a different stack. Thanks!
Disclaimer: dev of Karate here.
I don't know about mobile, but teams have been successful mixing Karate and Selenium / WebDriver into a single integrated script, which is possible because of Karate's Java inter-op.
This is a Stack Overflow answer recommending the above approach and this answer is an update from the same team reporting success.
One more reason you may want to consider Karate is that it may be the only framework that allows you to re-use functional test scripts as performance tests, via Gatling integration (still in development).
Karate in my opinion is a "safe" choice as a testing framework, because it is technically Gherkin and "language neutral". This may be a surprise for those new to Karate, but it actually leans towards using JavaScript for scripting instead of Java.
Of course, it is worth mentioning that I have yet to find a framework that makes testing GraphQL as easy as how Karate does.
Selenium and Rest assured integration framework is the answer to your question. I created a test automation framework to test an ionic application which is using GraphQL api along with Rest webservices. I have used Testng and cucumber in my framework to perform web app side validations and used Rest assured along with GSON to validate the GraphQL and rest services. You can easily integrate appium in your framework along with selenium and rest assured to cater the need of mobile testing.

MobileFirst - Use PHP / call RPG

i have two small questions about the mobilefirst- Server.
I found out, that the mobilefirst (or Worklight)-Server doesn't support PHP.
(IBM Worklight 6.0 - How to include a PHP file?)
Is that still so? Or is there any plan to include PHP?
Then I want to call RPG's with an Java-Adapter.
But I doesn't find any full example for calling a RPG.
Also I want to call RPG's with a Display File. Is that possible?
In the following article it sounds like it is easily possible:
http://www.it-zoom.de/dv-dialog/e/vom-greenscreen-zum-touchscreen-10865/
IBM MobileFirst server sits on top of a WebSphere Java EE based App Server. The MobileFirst Platform Adapter pattern is a server-side layer that provides abstraction to any generalized end-point; including PHP, SQL, SAP, whatever. So as long as your final endpoint is capable of acting as a "service", accepting HTTP requests, and producing JSON/XML responses, this pattern should work fine. The basic flow is:
mobile app client calls the MFP adapter
adapter calls the final endpoint (PHP/RPG in your case)
Endpoint responds with JSON/XML data
Adapter optionally converts response to JSON
Mobile client app receives and processes (displays) a consistent response from the adapter.
Hope this helps clarify the pattern for you.
PHP is a server-side HTML rendering technology. MobileFirst is (partly) for building hybrid mobile applications, which run on the client (mobile), so PHP wouldn't be relevant.
I'm not sure what an RPG is. Please can you specify the acronym in your question?

WCF callback and non WCF client [duplicate]

This question already has an answer here:
WCF Callback: Is it interoperable with Java?
(1 answer)
Closed 9 years ago.
I wonder if you can use WCF callback with a client not implemented in .NET. Google could not answer me for that.
Thanks
Do you mean 'can a non-WCF client app support WCF's duplex messaging capability?'
If so, then, of course it can - but you may have to build the client-side code yourself ... and doing so is unlikely to be a trivial task.
Question: Since Mono runs almost everywhere, can you not build your client app using Mono?