/Tag: Spring

REST HATEOAS with Spring

REST HATEOAS with Spring The Richardson maturity model breaks the REST architectural style into various levels of maturity. Level zero describes a system that uses HTTP as a transport mechanism only (also known as URI tunnelling). A single URI and HTTP verb is typically used for all interactions with POX (plain old XML) being posted over the wire. Old school SOAP-RPC is a good level zero example. Level one describes a system that builds on level zero by introducing the notion of resources. Resources typically represent some business entity and are usually described using nouns. Each resource is addressed via a unique URI and a single [...]

By |2019-02-07T08:02:28+01:00July 18th, 2017|REST, Spring Boot|0 Comments

REST Endpoint Testing With MockMvc

REST Endpoint Testing With MockMvc In this post I'm going to show you how to test a Spring MVC Rest endpoint without deploying your application to a server. In the past, full integration tests were the only meaningful way to test a Spring REST endpoint. This involved spinning up a test server like Tomcat or Jetty, deploying the application, calling the test endpoint, running some assertions and then terminating the server. While this is an effective way to test an endpoint, it isn't particularly fast. We're forced to wait while the entire application is stood up, just to test a single endpoint. An alternative approach [...]

By |2019-02-11T07:31:42+01:00May 25th, 2017|REST, Spring Boot, Testing|0 Comments

Spring Boot REST Tutorial

Spring Boot REST Tutorial Spring Boot makes it easier to build Spring based applications by focusing on convention over configuration.  Following standard Spring Boot conventions we can minimise the configuration required to get an application up and running. The use of an embedded Servlet container allows us to package the application as an executable JAR and simply invoke it on the command line to launch the application. One of my favourite things about Boot is its emphasis on production readiness. Out of the box it provides a number of key non functional features, such as metrics, health checks and externalised configuration. In the past these [...]

By |2019-02-18T07:23:41+01:00December 1st, 2015|REST, Spring Boot|11 Comments

Spring Batch Tutorial

Spring Batch Tutorial Spring batch is a lightweight framework that provides a solid foundation on which to build robust and scalable batch applications. It provides developers with a set of tried and tested patterns that solve common batch problems and allows developers to focus more on the business requirement and less on complex batch infrastructure. Spring batch contains a variety of out of the box configurable components that can be used to satisfy many of the most common batch use cases. Extensive XML configuration and an extensible programming model mean that these components can be customised and used as building blocks to quickly deliver common [...]

By |2019-02-20T07:28:02+01:00April 18th, 2014|Spring, Spring Batch|15 Comments

Spring AOP Tutorial

Spring AOP Tutorial Application logic can be broken into 2 distinct areas, core business logic and cross cutting concerns. Business logic is code written to satisfy a functional requirement, while a cross cutting concern is 'utility' logic that is agnostic to a specific business process but required by many parts of the application. Examples include logging, transaction management, performance monitoring and security. While none of these address a functional requirement, they remain fundamental parts of the application. Cross cutting concerns present 2 main challenges. They tend to be 'scattered' across the application which can lead to considerable duplicate code. Logging or performance monitoring is a good example. They [...]

By |2019-02-20T07:51:13+01:00April 23rd, 2013|Spring|5 Comments

Spring Quartz Tutorial

Spring Quartz Tutorial In this post I’ll show you how to use Quartz scheduling with a Spring application. Quartz can be easily integrated with Spring to invoke schedule tasks that call your existing business logic. One of the things I really like about Springs support for Quartz is that you don't have to write any Quartz specific code or amend your existing code to use Quartz scheduling. You simply configure Quartz alongside your existing bean definitions and point it at the logic that you'd like to invoke. Tech Stack Our Spring/Quartz example will be built as a stand alone Java application using the following. Spring 3.1 [...]

By |2019-02-21T07:23:22+01:00September 2nd, 2012|Spring|13 Comments