Spring

RestTemplate in Spring Boot

RestTemplate in Spring Boot | RestTemplate class is used to make an HTTP call to any web service Application (java and non-java apps) that reads the final response into ResponseEntity or a direct time. It supports auto-type conversion of Input/Output into GlobalFormat (i.e. Object to JSON/XML and JSON/XML to Object). Use case:- Movie Booking application […]

RestTemplate in Spring Boot Read More »

Spring Boot Rest API Unit Testing (JUnit with Mockito)

Spring Boot Rest API Unit Testing (JUnit with Mockito) | The spring-boot-starter-test dependency includes junit-jupiter, vintage, mockito dependencies. Mocking means creating dummy implementations or objects. If we want to test the Spring Boot application, then the following dummies are required:- We need to provide all the above details using Mock support. If run starter class

Spring Boot Rest API Unit Testing (JUnit with Mockito) Read More »

Swagger with Spring Boot REST

Swagger with Spring Boot REST | POSTMAN Tool tests our rest controllers. This is a fully manual tool, we should enter all details: URL, MethodType, Param, JSON Input, Header Details, etc. We should list all URLs in the application, if it is a small application then it is fine. But if the application is big

Swagger with Spring Boot REST Read More »

Spring REST Introduction

Spring REST Introduction | We will discuss Spring REST, HttpStatus, ResponseEntity, Request Method, and e.t.c. Webservices (ReST) Web services represent the integration of Applications. Linking two or more applications that are running on the same/different servers. 2 different web services can be in different technologies/languages. For example, one web service uses Java and another one

Spring REST Introduction Read More »

MediaType Annotations and HttpStatus

MediaType Annotations and HttpStatus | Here we will discuss @RequestBody, @ResponseBody, and HttpStatus. @RequestBody and @ResponseBody in Spring REST Using @ResponseBody is optional because @RestController will take care of that. But @RequestBody annotation must be applied externally. Example Application Create a Spring starter project and add the following dependencies:- Lombok, Spring Web. Start the application.

MediaType Annotations and HttpStatus Read More »