how to testing of services having Apache Thrift based RPC protocol using karate [duplicate] - karate

We have a requirement where we need to send .avro file as an input request to our API's. Really stuck at this point. If any detail example provided would be more appreciated.

Just use Java interop: https://github.com/intuit/karate#calling-java
You need to write a helper (start with a static method) to convert JSON to Avro and vice versa. I know teams using this for gRPC. Read this thread for tips: https://github.com/intuit/karate/issues/412
Also there is even a "karate-grpc" project: https://github.com/pecker-io/karate-grpc
Also see:
https://twitter.com/KarateDSL/status/1128170638223364097
https://twitter.com/KarateDSL/status/1417023536082812935

Related

Karate DSL: Support for Apache Thrift [duplicate]

We have a requirement where we need to send .avro file as an input request to our API's. Really stuck at this point. If any detail example provided would be more appreciated.
Just use Java interop: https://github.com/intuit/karate#calling-java
You need to write a helper (start with a static method) to convert JSON to Avro and vice versa. I know teams using this for gRPC. Read this thread for tips: https://github.com/intuit/karate/issues/412
Also there is even a "karate-grpc" project: https://github.com/pecker-io/karate-grpc
Also see:
https://twitter.com/KarateDSL/status/1128170638223364097
https://twitter.com/KarateDSL/status/1417023536082812935

Accessing the built request details in Karate

Just like how the response information can be accessed through response, responseHeaders etc, is there any way to access the request information? I noticed that request information is not available through variables. Are there are any workarounds to access this information?
I understand that we build the request ourselves in the test scenario using the Given, When steps, so it may sound redundant. The reason I'm looking for this is I would like to access the complete request details Karate would've built using our test definition. The idea is to make this information available to a java class which can be called through the Java Interop. More specifically, I'm trying to build a swagger request and response validator to be used from karate.
The workaround I am using is to explicitly create variables like apipath and apimethod and use them with path and method. This does the job, but still one has to ensure that these variables are explicitly set. It will be cleaner if whatever request Karate built is just accessible through a variable.
Please raise a feature request. We can look at making this available as karate.request or similar.

Savon::UnknownOptionError: convert_dashes_to_underscores

I am using Savon 2.11.1 as a Ruby SOAP client.
Savon uses Nori to translate the SOAP response XML to a Hash. Nori supports the option convert_dashes_to_underscores which by default converts all dashes in SOAP response to underscores.
I tried to use this option in the client's constructor but I got the following error message
Savon::UnknownOptionError: Unknown global option: :convert_dashes_to_underscores.
Why is this option not supported for Savon? Any workaround?
Thanks
M
I don't know why it isn't supported. I guess because nobody needed it up until now. I propose you extend the code, create the unit tests, upload the sources to github and send a pull request to the main project. Simple as that.
You can also look into the documentation where you'll find that the following symbols are available to control conversion
:camelcase
:lower_camelcase
:upcase
:none
http://savonrb.com/version2/globals.html

RESTful Service not working for multiple calls

I have created a Restful Service which accepts input xml and outputs response xml. Before giving output xml it calls Web Service and gets the xml from it. I do some modifications to the xml and output it.
The client reports that when they do load testing, sometimes the response comes properly and sometimes does not from RESTful Service.
How can I do load testing with JMeter and find the loophole in it. This happens for multiple calls.
2 great references for jmeter are:
- http://blog.milamberspace.net/ if you talk french
- http://theworkaholic.blogspot.fr/ if not
But you should definitely start by reading :
- http://jmeter.apache.org/usermanual/index.html
Then ask questions on jmeter user list if you are stuck.
Regards
Philippe
First create new test and save test scenario with JMeter Proxy (records user clicks in a browser).
Then use the recorded components to compose your actual test.
Don't forget to use JMeter Plugins (invaluable).

Is there an Objective-C client for Cassandra?

I want to access a Cassandra instance in an Iphone application and i need an objectiveC client
for that. I couldnt find one, Thrift is supposed to support ObjectiveC but I couldnt figure out how to do that. If anyone has any knowledge on the subject it is very much appriciated.
Apache Thrift has a generator for ObjC. (Complete list).
If you will distribute the application I would considered the alternative to create a server with simple interface (eg. http) that in turns access the cassandra database.
But if you are the only user it could work with direct database access.
If you're not sure about how to get Thrift to generate the bindings then go with what Schildmeijer posted. Use a simple web server running php + phpcassa or any language of your choice that comes with a high level client library -- list here: High level clients.
You can use some open source libraries to expose resources from Cassandra as JSON or XML then use NSURLRequests to do the work. If you go with XML then Google's GDataXML is an excellent choice of parser, if you go with JSON then json-library on Google Code is another great choice.
Have fun!