How to use Get.resource("path") REST APIs using Serenity Screenplay with HTTPS Validation as an Actor - serenity-bdd

I'm new in Serenity BDD and I'm trying to use Get.resource() method as an Actor for API Test but I need to turn off the SSL validation, could you please help me on that?
tom.attemptsTo(
Get.resource("/today")
);
Thanks a lot

Related

E2E Testing a frontend and mock a request the backend is making with Cypress

Currently when creating a customer during an e2e testcase, my stripe-like payment gateway says "Customer already exists" which is true because this testcase has been run once already.
What is the high level solution? If it would be a unit test, I think mocking the payment-provider request would be the way to go. But in this case I can only intercept the requests that go from my frontend, right? I could mock away the whole request to my backend but that's not the point of e2e testing I think.
I also thought about some sort of flag or environment variable so that the backend knows if it's currently e2e tested (and in this case behave differently, eg not make this specific request). But I think that's not good practice.
Okay I figured out something. I think e2e should test the integrated services too, like the integration between my backend and the payment gateway.
When the test starts, I modify the email (which was the duplicate key for the payment provider) by doing the following little code snippet. Works for now and I think it's not that bad:
user.email = user.email.split("#").join(`${Date.now()}#`);

How to test gRPC APIs?

I have been assigned to test a gRPC API (written in Golang) but I don't know how to go about testing it and I couldn't find any tutorials online for this type of testing. The only method that I can think of is to write unit tests to test the methods themselves but I would like to also test it with a client. For example, I have tested REST APIs in the past using JMeter as a client to send requests and verify the response data. Is there a method for testing gRPC APIs with a client or is unit testing the only way?
Well, I was in search for a client like Postman, then i found bloomrpc, which helps in calling grpc services. But i am not sure if it serves your purpose, if you are looking for a tool like jmeter.
If you are searching for a tool like Postman, there is also https://kreya.app. With it, you can call your gRPC services and view the responses.
Disclaimer: I'm one of the authors of Kreya.
Since you mentiond you've done testing before with JMeter, I assume that you're looking for an external test client that can call the gRPC service. There are several that you can use. The common ones are
BloomRPC
Kreya
Wombat
Fint
With those 4 clients, you can dynamically call gRPC services. However, if you are looking a test client that can also do load testing, Fint is the one you will need.
There can be two type of testing.
Testing just the implementation of the gRPC method by ignoring the networking
this question answers this aspect of the testing. By just writing the unit test for the RPC method
If you want to test both the implementation and the gRPC networking aspects as well then you need write the gRPC client for the service you want to test.
Here a code snippet about creating a gRPC client
// Set up a connection to the server.
conn, err := grpc.Dial(address, grpc.WithInsecure())
// Execute RPC you want to test
r, err := c.SayHello(context.Background(), &pb.HelloRequest{Name: name})
Check here for complete code example
Postman just published they have grpc in beta :
https://blog.postman.com/postman-now-supports-grpc/
I tested it just now and it worked perfectly for me 👍🏻🙂
You can also try this command line tool, evans, for testing gRPC
For anyone who stumbles upon this thread ...
All the previous answers have already provided good tools. We used BloomRPC & Kreya in our team (individual choices).
What I want to add is this gRPC Ecosystem Page. It contains a curated lists of all related tools. There are other GUI test tools (see GUI section), or Load testing, benchmarking tools (Testing)
https://github.com/grpc-ecosystem/awesome-grpc
PS : I'll be honest, I have not able to check all tools besides BloomRPC & Kreya.

in XACML(eXtensible Acces control markup language)

I am a student in Uni-Siegen.
For two weeks I am trying to define the communication between PDP and the PAP, but I do not know how to do it.
I would like to do it in java. What APIs can help me? Forget someone has a sample code and how to configure exclipse.
You can use SunXACML api to build PDP and PEP. Create a blank java project in eclipse and add SunXACML jar in your project's build path. Then follow the following guide to implement a simple PDP and PEP in JAVA. Then test them using some XACML policies.
http://sunxacml.sourceforge.net/guide.html

RSpec tests for Evernote API

I have a Rails app that makes calls to the Evernote API. I want to write RSpec tests for these calls. What's the best way of doing that? I know I can use Webmock or VCR, but - unless I'm mistaken - I would not then be able to have self-contained tests in my repository without pushing either my secret key or a cached oauth response.
VCR provides a simple way to filter out sensitive data like secret keys:
https://relishapp.com/vcr/vcr/v/2-4-0/docs/configuration/filter-sensitive-data!

Struts controller/porccessor monitoring/log utility

I'm looking for some kind of monitoring tool to visualize/log all internal struts forwards together with all http headers, parameters, request and session attributes values.
The intend is to understand the full flow of certain request in struts 1.x application.
Thanks a lot.
Use MaintainJ to monitor all calls and methods in java web application... And in firefox install 'firebug' run it select net tag... Under this tag you can see every server call and response of that call... Chrome too have this feature...