Home » Tag Archives: Spring (page 3)

Tag Archives: Spring

Testing Spring Data + Spring Boot applications with Arquillian (Part 2)

In previous post, I wrote about how to test Spring Data application using Docker with Arquillian Cube. The test looked like: @RunWith(SpringRunner.class) @SpringBootTest(classes = PingPongController.class, webEnvironment = RANDOM_PORT) @ContextConfiguration(initializers = PingPongSpringBootTest.Initializer.class) public class PingPongSpringBootTest { @ClassRule public static ContainerDslRule redis = new ContainerDslRule("redis:3.2.6") .withPortBinding(6379); @Autowired TestRestTemplate restTemplate; @Test public void should_get_pongs() { // given restTemplate.postForObject("/ping", "pong", String.class); restTemplate.postForObject("/ping", "pung", String.class); // when final List<String> ...

Read More »

Clean Code from the trenches

spring-interview-questions-answers

Clean Code from the trenches – Validation Let’s directly start with an example. Consider a simple web service which allows clients to place order to a shop. A very simplified version of the order controller could look something like below – @RestController @RequestMapping(value = "/", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) public class OrderController { private final OrderService orderService; public ...

Read More »

Testing Spring Data + Spring Boot applications with Arquillian (Part 1)

spring-interview-questions-answers

Spring Data’s mission is to provide a familiar and consistent, Spring-based programming model for data access while still retaining the special traits of the underlying data store. It provides integration with several backend technologies such as JPA, Rest, MongoDB, Neo4J or Redis to cite a few. So if you are using Spring (Boot) then Spring Data is the right choice to deal ...

Read More »

Spring Boot, @EnableWebMvc And Common Use-Cases

spring-interview-questions-answers

It turns out that Spring Boot doesn’t mix well with the standard Spring MVC @EnableWebMvc. What happens when you add the annotation is that spring boot autoconfiguration is disabled. The bad part (that wasted me a few hours) is that in no guide you can find that explicitly stated. In this guide it says that Spring Boot adds it automatically, ...

Read More »

Spring Web-Flux – Functional Style with Cassandra Backend

spring-interview-questions-answers

In a previous post I had walked through the basics of Spring Web-Flux which denotes the reactive support in the web layer of Spring framework. I had demonstrated an end to end sample using Spring Data Cassandra and using the traditional annotations support in the Spring Web Layers, along these lines: ... import org.springframework.web.bind.annotation.*; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; ... @RestController @RequestMapping("/hotels") public class HotelController ...

Read More »

Spring Batch Restartability

spring-interview-questions-answers

First of all, I’d like to give a big thank you to the wonderful folks from Spring who have given countless hours of their time to ensure the viability of Spring Batch jobs, and the seemingly magical ability to issue restart on a job! Thank you for this elegant toolset that permit us to tear through massive datasets, while enabling ...

Read More »

Use Spring Cloud Config as externalized configuration

spring-interview-questions-answers

One of the most important practices when it comes to continuous delivery is building your binaries only once and use that one in the different environments (dev, test, acceptance, etc). This means that most likely you will need to externalize your configuration of your application. With Spring Boot applications it comes down to keep the values of your properties in ...

Read More »

Auto-Publishing & Monitoring APIs With Spring Boot

spring-interview-questions-answers

If you are heading down the path of a Microservices style of architecture, one tenant you will need to embrace is automation. Many moving parts are introduced with this style of architecture. If successful, your environment will have a plethora of service APIs available that the enterprise can consume for application development and integration. This means that there must be ...

Read More »

Want to take your Java skills to the next level?

Grab our programming books for FREE!

Here are some of the eBooks you will get:

  • Spring Interview QnA
  • Multithreading & Concurrency QnA
  • JPA Minibook
  • JVM Troubleshooting Guide
  • Advanced Java
  • Java Interview QnA
  • Java Design Patterns