I am trying to see if i can automate a spring boot batch processing built with JDBC template and i have never worked on it. i automate web based projects using cucumber and selenium web driver. Is it even possible? help please.
Thanks
If I understand you correctly, it is possible to write automated tests for spring boot batch application using cucumber.
This is how I have it implemented -
Dependencies - cucumber-java, cucumber-junit, cucumber-spring
gherkin features like usual
cucumber test cases - use SpringApplication.run(YourApplication.class) to run the Spring Boot application, an use SpringApplication.exit() - to verify exit status codes for Batch as needed.
Here is an article which I found helpful for integrating cucumber with Spring Boot - http://www.baeldung.com/cucumber-spring-integration
Related
I created a Spring reactive based Controller/repository and use r2dbc-postgresql driver.
Previously, for testing classical Spring boot REST service I use EmbeddedPostgres. I tried to add the same for the reactive based controller but instead of embedded postgres it tries to connect to the normal local PostgreSQL DB.
Looks like async PostgreSQL driver is not compatible with embedded.
Is there any way to let them work together in my integration tests?
I am a beginner to Spring and I would like to set up a full stack RestFul project using Maven, ReactJS. I am stuck with where should I begin with since I browse Spring website and they provide both Spring and Spring boot.
Could someone tell me how can I set up an easy example using Spring + Maven + ReactJS.
I appreciate a lot.
Spring boot is Spring + High Productivity Boost. You can fork and (or) check out this excellent Spring boot + ReactJs webapp example from github and follow the tutorial here. If you want to learn more about the various features of spring boot, see its section on spring io website
Spring Boot comes with a neat remote monitoring shell (http://docs.spring.io/spring-boot/docs/current/reference/html/production-ready-remote-shell.html) that's installed into Spring Boot apps by adding spring-boot-starter-remote-shell dependency. It provides access to Spring beans, jdbc, allows extension by custom commands, plugs into Spring Security for authentication, you can connect to it via SSH etc...
I would really like this feature in my regular non-boot Spring MVC application. I've searched the internet and Spring docs and found nothing. Any ideas how to achieve this besides reverse engineering spring-boot-starter-remote-shell sources?
I'm testing a Spring web MVC application with heavy RESTful invocation that POST and DELETE a remote resource on demands.
When I'm trying to run integrated test, obviously I need to test POST first and then DELETE second. Unfortunately JUnit doesn't support such dependency test, and the vanilla JExample class cannot be run with Spring application context. Is there a feasible way of using both?
I am looking for a method for testing Alfresco repository Java services without the need for deploying to a Tomcat server.
My idea is to start Alfresco embedded from a JUnit testclass, inject the classes I want to test into the Alfresco Spring configuration and test the classes using JUnit test methods.
The Alfresco sample application "FirstFoundationClient" is a good entry point for getting the above working but when I try to start the sample with a H2 memory database in MySQL-mode it outputs the following error:
SqlMapException: The <sqlMap> resource is missing: /alfresco/ibatis/#resource.dialect#/qname-insert-SQLMap.xml
My alfresco-global.properties configuration in the sample project:
dir.root=./alf_data
db.driver=org.h2.Driver
db.url=jdbc:h2:alf_data/h2_data/alfresco;MODE=MySQL
db.username=alfresco
db.password=alfresco
Can anyone help me with:
how to get FirstFoundationClient (from Alfresco Enterprise SDK 3.4.0) running using a H2 database
how to inject the classes under test so I can access them from the Spring application context (like standard Alfresco services are accessed in the FirstFoundationClient sample)
If you're willing to give the maven way a try, I published a little tutorial about how to use H2 with Alfresco. Here's a project where I'm leveraging that approach that you might use as a template.
NOTE: Alfresco v4.x might not be compatible with H2 - PostgreSQL mode
EDIT: the new h2-support v1.2 supports Alfresco4
EDIT: h2-support now supports up to Alfresco 4.0.2