5 out of 5
5
1 review on Udemy

Develop Micro-Services API via Test Driven Development

Hands on TDD - engage & deliver quality production code; Go Full Stack
Test Driven Development way of writing Micro-Services. The complete journey of Acceptance test, Integration test, unit test has been demonstrated, which would help you to master Test driven development (TDD).
This course lay emphasis on Designing and coding the medium to complex story in working micro-service APIs via TDD & BDD as well as advance concepts to design a test for mocking API call with Junit, wire-mock, MockBean and MockMvc. The concept and use of Swagger file in developing the app.
The bonus lecture on how to create rest-assured based AUTOMATED TESTING TO TEST Micro-service API as user.

Micro-Service API development via Test Driven Development (TDD) or Design By Test (DBT) course focuses on how to write production code for Micro service APIs in spring boot. This course lay emphasis on Designing and coding the medium to complex story in working micro-service APIs via TDD & BDD as well as advance concepts to design a test for mocking API call with Junit, wire-mock and MockMvc.

The basics knowledge of java is added advantage but not the requirement to understand the Design by Test concepts.

The flow of the course takes you with ease to demonstrate and make you understand about the beauty of how test dictates the production code.

The complete journey of Acceptance test, Integration test, unit test has been demonstrated, which would help you to master TDD.

The bonus session on how to create AUTOMATED TESTING TO TEST Micro-service API as user via REST-ASSURED.

Introduction

1
Introduction - About the course

Overall scene setting about the course delivery method and content at glance. Overview of technology stack, one will learn though out this course.

What & why MicroService?

1
What Is Micro-Service & API

What is Micro-Service and Information Technology industry trend about it.

Problem Statement or story about application.

1
Story or Problem Statement about application to be developed in Micro-service

Understanding the use-case/story/problem-statement about the application , we are going to develop via Test Driven Development and Design by Test approach.

It is medium to complex story, if you are familiar with scrum.

Pre-requirement

1
Pre-requirement or machine/environment setup

Your machine (laptop/Desktop) requirement , environment setup and general development environment setup tips. This is important to for practical coding activities.

Download the skeleton project provided and get started!

Key Coding Activity

1
About the coding activity - Hands on

Overview of coding activities, we are about to begin to develop Rating Control Service App via TDD and DBT (Design By Test) approach.


You can get hold of ebook shown in course by following the link under resources.

Contract First : Swagger

1
Creation of Swagger File and Code Generation via maven plugins

Swagger is an open-source software framework backed by a large ecosystem of tools that helps developers design, build, document, and consume RESTful Web services.

While most users identify Swagger by the Swagger UI tool, the Swagger toolset includes support for automated documentation, code generation, and test-case generation.

Behavioural Driven Development

1
Acceptance Criteria - Cucumber feature file

Behavioural Driven Development (BDD) is a software development approach that has evolved from TDD (Test Driven Development). It differs by being written in a shared language, which improves communication between tech and non-tech teams and stakeholders.

In both development approaches, tests are written ahead of the code, but in BDD, tests are more user-focused and based on the system’s behavior.


BDD - Glue and Step Definitions

1
Cucumber Step Definitions glue creation

A Step Definition is a Java method with an expression that links it to one or more Gherkin steps. When Cucumber executes a Gherkin step in a scenario, it will look for a matching step definition to execute.

Rest Controller Integration Test - Part 1

1
MockMvc and Edge Cases of RestController

Learn to use Spring MockMVC to perform integration testing of Spring webmvc controllers. MockMVC class is part of Spring MVC test framework which helps in testing the controllers explicitly starting a Servlet container.

Rest Controller Integration Test - Part 2

1
RestController Acceptance Criteria

Learn to use Spring MockMVC to perform integration testing of Spring webmvc controllers. MockMVC class is part of Spring MVC test framework which helps in testing the controllers explicitly starting a Servlet container.

Overview of Service Implementation

1
Service Business Logic Test Approach Explained

Service Implementation is considered as main task in micro-service API development, since it contains the real business logic of the app.

So correct  test design which complement the business requirement is vital.

Service Implementation - Hands On

1
Service Business Logic Test Design

Service Implementation is considered as main task in micro-service API development, since it contains the real business logic of the app.

Remaining attribute of app code are generated from SWAGGER and we arranged them in order.

Rest Template

1
RestTemplate Bean Creation

The RestTemplate is the basic Spring class for simultaneous client-side HTTP access. It simplifies the interaction with HTTP servers and enforces RESTful systems.

Refactor - An Overview

1
Refactor - Red -Green-Refactor

The KEY to Test Driven Development is RED-GREEN -REFACTOR.

Refactor makes our code further reusable and properly organised along with decouple.

Code Refactor - Hands On

1
Code Refactoring

Exception Handling

1
Exception Handling Acceptance Criteria

BookNotFoundException & TechnicalFailureException implemented.

Also ways to avoid boiler plate code (try-catch) in controller.

Edge Cases Service Implementation

1
Edge Case for Service Implementation

Apart from stated requirement - SMART professionals do explore possible edge cases. Address the pitfall by test design to break their own code logic and rectify  production code.


This considerably reduces production BUG/ISSUES.

Revisit RestController Test

1
Revisit RestController Integration Test

In TDD -

Cycle is to :

  • -->Write Acceptance Test (BDD) - Test fail,

  • -->move to Controller (IT) Integration Test (mockMvc) - Test fail,

  • -->move to Service Junit Mockito.

Implement the Service for acceptance business requirement.

Come back to Controller IT  test, integrate the service - Test PASS

Revisit BDD Test (Section -21) , Implement wire-mock to mock 3rd party Call - Test PASS


Your 1 iteration of working software with 1 acceptance criteria is DONE.

REPEAT the process again.

ResponseEntityExceptionHandler

1
Controller Advisor - ResponseEntityExceptionHandler

ResponseEntityExceptionHandler is quite handy @ControllerAdvice. It help to manage response for the controller in exception scenario.

This help to avoid boiler plate code (try-catch) in Controller class.

It enhances your app exception handling capability far efficient manner.

Famous Error - Address Already In Use

1
Address Already In Use - Tips

'Address already in use' is quite common error, You may get this error - during starting your application, running you BDD- cucumber test etc.

Hence it is important to know its root cause as well as possible fix.

Wire-Mock in Cucumber

1
Wire-Mock- In BDD Step Definition to mock 3rd Party Api Call in Service

WireMock is a simulator for HTTP-based APIs. Some might consider it a service virtualization tool or a mock server.

It enables you to stay productive when an API you depend on doesn't exist or isn't complete. It supports testing of edge cases and failure modes that the real API won't reliably produce. And because it's fast it can reduce your build time from hours down to minutes.

Automation Testing- Rest-Assured

1
API Automation Testing

APIs are playing an ever more important role in software trends (such as mobile applications, the Internet of Things, etc.), proper automated testing of these APIs is becoming indispensable.

There are many different tools out there that can assist you in writing these automated tests at the API level. I'm going to show you how to use one of the most popular open-source tools for this task: REST Assured.


REST Assured is a Java library that provides a domain-specific language (DSL) for writing powerful, maintainable tests for RESTful APIs.

Further Reference & Study Materials

1
Full Stack Developer - Further Study Material

Congratulation!! You Have made it. Well DONE!


I am sure you must have enjoyed the course as well as got your enhance skilled in writing quality API software via TDD.


Why Not look at other reading and 'to the point' material of mine.

Please find complete working app of 'Rating-Control-Service' DONE!!


You can view and review the lecture materials indefinitely, like an on-demand channel.
Definitely! If you have an internet connection, courses on Udemy are available on any device at any time. If you don't have an internet connection, some instructors also let their students download course lectures. That's up to the instructor though, so make sure you get on their good side!
5
5 out of 5
1 Ratings

Detailed Rating

Stars 5
1
Stars 4
0
Stars 3
0
Stars 2
0
Stars 1
0
4efc8c4f424632462bdcee6132084d73
30-Day Money-Back Guarantee

Includes

3 hours on-demand video
Full lifetime access
Access on mobile and TV
Certificate of Completion