Spring

 How do I set up REST Assured & Cucumber in Spring Boot App?

Kimberley Cunningham's profile image
Kimberley Cunningham posted Jun 02, 2018 11:32 PM

**'This question came from a Spring User**

Hi,

I am working on a Java Spring Boot App at the moment in STS (Eclipse).

I am looking to add REST Assured and Cucumber to the project so I can automate testing.

I understand how Cucumber and REST Assured function, I understand how to write the Feature Files, etc. but I don't know how to actually import REST Assured and Cucumber into my project.

The only tutorials I have seen online involve Maven projects, but as mentioned above, I am working on a Spring Boot App.

Would someone be able to kindly detail the required steps to import REST Assured and Cucumber into a Spring Boot App, or perhaps link a tutorial that does this (which I haven't found).

Thanks a lot for reading this, I appreciate any advice/feedback.

 

 

Kimberley Cunningham's profile image
Kimberley Cunningham

Check out the docs here <"https://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#using-boot-build-systems">.

Spring Boot does not provide it's own dependency management system, but it enhances the common build systems making it easier to manage your dependencies. You would typically use Maven or Gradle to manage your dependencies with Spring Boot (although you can technically use Ant+Ivy too). Dependency management works just like Maven or Gradle in any other project with two conveniences added.

1.) Spring Boot manages a curated list of dependencies <https://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#using-boot-dependency-management> that are known to work well together. In short, it "recommends" you use certain versions of dependencies and if you follow its recommendations then things normally just work. This takes the burden of deciding what versions to use off you. It also updates your dependency versions as you upgrade Spring Boot.

Plus, because it's just a recommendation, you can override the version if you need to use a specific version of a dependency. You always have the final say.

2.) Spring Boot provides what are called "starters". These can be thought of as feature bundles that make working with certain technologies easier. The starter might pull in a set of dependencies, but it can also add configuration so that usage of the features just works. Examples of bundles are Spring Web, Spring JDBC, JPA, Actuator, etc..

If there is *not* a "starter" for your technology that is perfectly OK. A starter is not required to use a particular technology with Spring Boot. A starter might make using that technology easier with Spring Boot, but it's not required. If there is no starter for your particular technology, that just means you need to add the dependencies (see #1) manually and that you need to create the Spring beans/configuration needed to set up the technology.

Hope that helps!