First Step Toward Spring Boot Cloud Gateway

Introduction This tutorial is a short introduction to Spring Cloud Gateway. By following the quick and easy steps provided below, you will be able to start the REST API gateway project. Prerequisite Java Maven Spring Boot Download the Spring Boot project from Spring Initializr and select Gateway as dependency. Now generate and download the project and use your favourite editor to import it. Gateway Configuration You can use a YAML file or Java code to configure routes....

November 7, 2022

How To Use json-server To Build Mock REST API Server

Introduction A mock REST API server will often expedite your integration testing, and this tutorial will give you insight into one such server. This tutorial will walk through each step of setting up and using a fake server. Software used in this tutorial NPM : 8.3.1 Node: 16.14.0 Json-Server: 0.17.0 Setup The first step is to make sure you have node and npm installed on your workstation, then follow the next commands....

November 3, 2022

Spring Boot File Upload With RestTemplate

Introduction This quick tutorial will show you how to use Spring Boot RestTemplate to upload a file to a server. The prerequisites for this tutorial are the following the server that accepts requests for multipart file uploads A RestTemplate instance Of course, a text file to upload. What You Need This tutorial uses following softwares Java: 1.8 Spring Boot: 2.7.4 Maven: 3.6.3 How to upload a file First we create an instance of RestTemplate as...

October 19, 2022
Angular Mutation Testing

How Angular Supports Mutation Testing With Example

Introduction This blog post is designed to serve as a comprehensive guide for developers looking to apply mutation testing into their Angular application. If you are that developer, you will be able to carry out mutation testing with ease by following the working configurations and examples provided below. If you just happened onto this tutorial, you will gain a decent understanding of mutation testing. Please see here for a definition of the mutation test....

August 26, 2022
Angular: Getting Started With Httpclient Unit Testing

Angular: Getting Started With Httpclient Unit Testing

Introduction This tutorial will help you understand the basics of unit testing for Angular HttpClient. Angular includes a testing module named HttpClientTestingModule that provides an HTTP mocking service, HttpTestingController to intercept the HTTP request and provide a mock response for it. Setup We begin by writing a service to fetch blogs from an application server. Use the following Angular cli commands to generate a service. Generate a module ng g module blogs Generate a service ng g service blogs/blog Now create the following classes inside the app folder....

July 26, 2022
Log4j How to Log Message to Console

Log4j How to Log Message to Console

Introduction This tutorial will help you to log all level messages into console using Log4j plugin. In previous tutorial we have seen how to setup the log4j plugin in Maven and simple logging application. If you need to understand the basic of Log4J the visit previous tutorial. What we will do in this tutorial We saw in the previous tutorial that Log4J’s default configuration set the logging level to Error, causing it to log only errors and fatal messages to the console....

June 1, 2022
Getting Started With Log4j

Getting Started With Log4j

Introduction For Java applications, Log4j is a commonly used and trusted logging tool. When an application is deployed to an application server, logging is a must-have feature. In this tutorial, we’ll see how to set up Log4j for a simple Java application. You can find all code related to this tutorial inside GitHub project. Why do we need Logging Logging is an important part of the application since it records user actions, input requests and output responses, error messages, and more....

May 30, 2022
Maven Create Jacoco Code Coverage Report

Maven Create Jacoco Code Coverage Report

Introduction In this tutorial we will see how to setup the JaCoCo plugin to generate a code coverage report for a Maven project. In order to generate a unit test coverage report, we should have sufficient unit test cases in our application. For this tutorial, I am referring to a Maven project which has a string manipulation method. You can find this project at this GitHub location. There are a few steps that need to be taken to produce the report....

May 26, 2022
Spring Boot Resttemplate Guide With Example

Spring Boot Resttemplate Guide With Example

What is RestTemplet? RestTemplate is a HTTP Client library that provides basic APIs for executing different HTTP type requests. RestTemplate is one of the HTTP libraries available on the market. The Spring Boot team designed and maintains it. As previously said, it is a client library, which means it may be utilised in our application as a stand-alone dependency. To utilise it, you don’t require a complete Spring boot application....

April 22, 2022
How to Change a Git Commit Message

How to Change a Git Commit Message

Introdcution In this tutorial, we’ll go over how to fix Git commit messages that have been committed to a local or remote Git repository. Reason to change commit message? When working with Git, there could be several reasons to update the commit message. Some of the common reasons are as follows Message contains a typo. Missing intent of commit. Remove any confidential information. Correct issue ticket number to connect to an issue tracker such as Jira....

April 19, 2022