Moises Macero's Blog, page 2

October 3, 2020

A Practical Example of Cucumber's Step Definitions in Java

This third section of the guide focuses on the Step Definition Java classes. We use the real example project, and map the Gherkin sentences to Java methods with the so-called Step Definition files. You���ll learn about Cucumber���s built-in Parameter Types and you���ll create your own one. Besides, we���ll put into practice the best practices to keeping the state in a separate abstraction layer.







> The Cucumber Java Guide


GitHub
...
 •  0 comments  •  flag
Share on Twitter
Published on October 03, 2020 22:00

September 26, 2020

Cucumber's skeleton project structure and API Client

The second part of this Guide introduces the real-life example project of Cucumber tests for end-to-end functional scripts. You���ll create the skeleton project, design the structure of packages and classes, and implement the HttpClient to trigger API calls to the backend system. Besides, we���ll add already two complete Cucumber���s Feature files using the most important Gherkin syntax���s functionalities.







> The Cucumber Java Guide


GitHub...
 •  0 comments  •  flag
Share on Twitter
Published on September 26, 2020 22:00

September 19, 2020

Introduction to Microservice End-to-End tests with Cucumber

In this first part of the guide, we cover the main concepts of BDD, TDD, Cucumber, and Gherkin. We detail the differences between the techniques and the tools, and how they can help improve the ways of working of your organization.







> The Cucumber Java Guide


GitHub




Learn how to build end-to-end tests with Java and Cucumber, using this step-by-step tutorial with practice code examples. This guide is pa...
 •  0 comments  •  flag
Share on Twitter
Published on September 19, 2020 22:00

Introduction to End-to-End tests with Cucumber

In this first part of the guide, we cover the main concepts of BDD, TDD, Cucumber, and Gherkin. We detail the differences between the techniques and the tools, and how they can help improve the ways of working of your organization.







> The Cucumber Java Guide


GitHub




Learn how to build end-to-end tests with Java and Cucumber, using this step-by-step tutorial with practice code examples. This guide is pa...
 •  0 comments  •  flag
Share on Twitter
Published on September 19, 2020 22:00

June 15, 2020

Full Reactive Stack ��� Introduction

This guide focuses on the capabilities of Spring WebFlux and Spring Boot 2 to create a��Reactive Web Application,��supported by a code example that you can build step by step.



To avoid��dumb, non-realistic examples where Spring is also the client of the Reactive API, you will complete the stack with a client application in��Angular 9. To make it reactive,��you���ll use Server-Sent Events (SSE) to communicate the backend with the frontend. See the figure below for a quick view of the stack we���...

 •  0 comments  •  flag
Share on Twitter
Published on June 15, 2020 23:30

Full Reactive Stack with Spring Boot, WebFlux and MongoDB

Within this chapter, you���ll learn how to develop the Reactive Web Server. We���ll use Spring WebFlux, available since Spring 5, and included from the Spring Boot 2.0 version. We���ll connect to a Mongo database using its reactive driver with Spring Data, also via Spring Boot.





Table of Contents


Project Reactor ��� Main Features
Overview
Fluxes and Monos
Reactor Integrations


WebFlux ��� Main Features
Standard Controllers and Router Functions
...
 •  0 comments  •  flag
Share on Twitter
Published on June 15, 2020 23:30

Full Reactive Stack ��� The Angular frontend

In the previous chapter, we created a Spring Boot application that offers a Reactive Web API. We���ll cover in this one how to implement the client���s side using��Angular��with��EventSource��and RxJS�����Observable.





Table of Contents


Goal
Why Angular?
Creating the Angular application
UI Application Overview
The Angular Reactive service
The Angular Components ��� Quick Overview
Running the frontend





This post is a blog version of one of the parts of the Ful...

 •  0 comments  •  flag
Share on Twitter
Published on June 15, 2020 23:30

Full Reactive Stack: Conclusions

In this final section, we run the application and see how everything works for the two different approaches: WebFlux with Server-Sent Events and MVC blocking classic. This post compares those two alternatives as well, in terms of user���s experience, performance and ease of development.





Table of Contents


WebFlux vs. Blocking (MVC): user experience
WebFlux vs. Blocking (MVC): performance
Benchmark details
Server���s Side: Requests Served per Second
Client���s Side: ...
 •  0 comments  •  flag
Share on Twitter
Published on June 15, 2020 23:30

June 3, 2020

How to test a controller in Spring Boot - a practical guide

There are different ways to test your Controller (Web or API Layer) classes in Spring Boot, some provide support to write pure Unit Tests and some others are more useful for Integration Tests. Within this post, I���ll cover the main three test approaches available for Spring: using MockMVC in standalone mode, MockMVC together with SpringRunner, and using SpringBootTest.







Updated: Code examples use Java 14 and Spring Boot 2.3 with JUnit 5.


Table of Contents


Introduction
The sa...
 •  0 comments  •  flag
Share on Twitter
Published on June 03, 2020 22:10

Guide to Testing Controllers in Spring Boot

There are different ways to test your Controller (Web or API Layer) classes in Spring Boot, some provide support to write pure Unit Tests and some others are more useful for Integration Tests. Within this post, I���ll cover the main three test approaches available for Spring: using MockMVC in standalone mode, MockMVC together with SpringRunner, and using SpringBootTest.







Updated: Code examples use Java 14 and Spring Boot 2.3 with JUnit 5.


Table of Contents


Introduction
The sa...
 •  0 comments  •  flag
Share on Twitter
Published on June 03, 2020 22:10