-
Notifications
You must be signed in to change notification settings - Fork 3
Core Principles
Sprimber is not a new BDD framework. It is not a replacement for JBehave, Cucumber and other. This is powerful tool that allow to merge Spring Framework capabilities with BDD implementations. It leverage all Spring community benefits with BDD approach for test automation. Here under test automation assumed set of tests that require already deployed application, not a unit test that require application in the same JVM.
The key difference between Sprimber and regular BDD-Sping integrations(Cucumber-Spring, JBehave-Spring) the entry point to the application.
Usually actor(somebody who trigger test automation) trigger maven build, that trigger surefire plugin, that trigger JUnit or TestNG framework, that trigger Cucumber/JBehave JUnit/TestNG runners that will be able to trigger BDD execution. In case of Spring integration this BDD runners also will be able to start Spring Context. Finally actor super detached from Spring container initialization and have very low ability to modify something in Spring configuration. By this Spring integration usually come so tough and complex.
By default Spring Boot provide simple ways to execute application:
- via executable jar - spring boot maven plugin will be able to assemble self executable jar(no execution, just build) on phase repackage. Then this jar can be distributed at different ways and finally executed at any runtime.
- via spring boot maven plugin -
spring-boot:run
,spring-boot:start
,spring-boot:stop
. Super powerful for local development when source rebuilding required.
Sprimber not a starter for Spring Boot, it is more like and additional framework that can be attached to the Spring container alongside with other tools like Hibernate, Spring Cloud and so on. In case of Sprimber the flow is more simple - actor trigger SpringBootApplication(via jar, or maven plugin), Spring setup the container with all required beans and integrations and then Sprimber starts. More about Sprimber lifecycyle can be found in next chapter.
Main benefit of Spring usage that actor is the owner of Spring container. It can produce next points:
- easy to configure additional integrations like DB, REST/SOAP, etc
- easy to configure multi threading execution - multiply thread pools can be configured for different purposes and then Spring
@Async
annotation can be widely used. By default Sprimber executes test scenarios in separate thread pool with capacity 3. - easy to modify Sprimber engine - everything inside of Sprimber is a Spring beans, so they can be override by client configuration or autowired and then configured in different ways(example of TypeRegistry for Cucumber)