Cucumber BDD test for Image File Upload API using spring boot? - spring-boot

I have a POST api "/api/user/profileImage" to upload image, developed with spring boot. I have to write Cucumber BDD test to validate the api, unfortunately I can't find much references for cucumber BDD Test Scenario for file upload operation. Please help me to solve this.

Related

How to configure embedded Geode/Gemfire for cucumber integration in a Spring-boot app?

I have a requirement of writing cucumber integration test for a spring boot application having Gemfire. I have tried looking for the references and documents, but couldn't find much about it. Can anyone help me with this?

Alternative to HTMLUnit as headless browser in testing Spring Boot applications

So in our project we are using spring boot with thymeleaf and vanilla javascript to render web pages. Now while writing our UI tests we are currently using HTML Unit as a headless browser as it integrates rather well with spring boot.
However , whenever we use a little advanced calls like array.flatMap etc html unit fails as its engine does nit support those.
So we are looking for an alternative to explore to plugin into our environment.
Can someone please advise a headless browser that we can integrate . into our spring boot application ? Also if possible any documentation to integrate will help?
Appreciate the help.
You can use Cypress running in a Docker container. To make this a bit easier you can use https://github.com/wimdeblauwe/testcontainers-cypress
Disclaimer: I am the author of the testcontainers-cypress library.

TestNG or Spring Test framework?

I have used TestNG+Rest Assured for rest api service testing(application is written based on Spring framework) and just want to know if it is better to use Spring test framework alone or integration TestNG+Spring test.
Thanks.
Use the combination of both.
TestNG will act as full featured test framework and Spring Test framework to mock spring beans (In other words, to get the out of the box spring support).

Rollback Integration Test which uses cucumber and tests the application on embedded tomcat via maven

I am trying to set up an integration test framework for my spring project using cucumber framework and selenium for UI automation.
What I have done till now is
Use tomcat7 plugin for maven and deploy my war file to this embedded tomcat
Use the cucumber feature file to specify any test cases, be it a rest service or for the UI automation
We need to use our existing development DB for test purposes
I will hit the app url for the application running on the embedded tomcat.
What I am unable to find out is, can we rollback a transaction automatically after the test is done?
I am able to rollback transactions from cucumber/junit that were directly using my DAO as the DB connection was initiated from the same spring context.
But when the invocations are made using this model, I am unable to find any idea to rollback the transactions after the tests are done.
Can you think of achieving your integration testing in terms of Spring profile? You can create a spring profile for integration test and use it as environment variable or using annotations to specify rollback for transaction.
Take a look at following references to get an idea:
Spring integration tests with profile
https://spring.io/blog/2011/06/21/spring-3-1-m2-testing-with-configuration-classes-and-profiles

Integrating Junit with Ruby-Cucumber-Watir?

Is it possible to integrate Junit with Ruby-Cucumber framework? If so, is there any documentation available for this?

Resources