Spring internals - BeanPostProcessor

java

Have you ever wondered how spring does things? How field annotated with @Autowired is populated? How asynchronous or scheduled methods are discovered. In this post, I’m going to take a deeper look and scratch a bit on the surface of spring internals. I’ll focus on BeanPostProcessor interface which can be used to achieve interesting things and is used in many various functionalities across spring framework itself.

20 Feb 2019

Deployment with gradle

java

I’ve been working with gradle for some time but I’ve never needed to configure deployment from gradle to maven repository. In this post, I’m going to configure deployment of java based gradle project to the nexus artifact repository. This will include uploading a signed jar itself with javadoc and sources.

6 Feb 2019

Introducing fluentXPath

java

Some time ago I’ve started working on updating automated tests written in selenium with java. After working a bit with it I’ve noticed that from time to time constructing XPath expression can get ugly. We are writing our tests in pure java and "ugliness" usually comes from string concatenation when some extra parameters must be taken into account. I’ve decided to write something that might help a bit with building XPaths without string concatenation.

22 Jan 2019

Dependencies BOM

java

Managing and versioning a bunch of connected libraries or services is hard. It doesn’t matter if you are a consumer or a provider of it. In this post, I’m exploring two simple solutions which might come in handy if you develop an ecosystem of libraries/services or when you are a consumer of those. It is all about semantic versioning and import scope of BOM in maven dependencies.

18 Apr 2018

Testing randomness

java

While deep diving into the code I very often see people struggle when testing random changing/things. There is a really simple solution for this and in this blog post, I’m going to show you "one simple trick" that will fix this problem.

20 Mar 2018

Testing MVC in Spring

java

Most of java web applications is built on top of the Spring Framework. Spring has pretty good support for testing and it is a mistake not to take advantage of features it offers. I’ve been developing various applications using Spring MVC for some time and I’ve noticed few patterns for testing that do work.

30 Jan 2018

Conversions in spring

java

The story is really simple. I wanted to accept my class as rest controller method param. I decided that I don’t want to convert a simple string to object every time and it would be faster if I do the conversion in the single place. After a quick research I’ve found Converter interface which looked like perfect for the job. After some digging and investigation it turns out that there is a lot of automagic in the Spring conversion service.

10 Nov 2017

Database migrations

java

Most of the application we are working on are built around the data. Since the information is the core value of the application we store it in the persistent and reliable storage - database. Applications evolve in time so does the way we store the data. In this post, I’m going to present my experiences and thoughts on evolving database schema.

31 Oct 2017

Poor's man domain events

java

While investigating @EventListeners in spring I’ve noticed very interesting annotation - @DomainEvents. In this post I’m going to check what can be achieved using @DomainEvents annotation and how to effectively use it with old good JPA. Let’s start with short introduction to domain event idea if you are not yet familiar with it. Now let’s go back to the @DomainEvents annotation in spring-data. Spring-data by default provides support for this annotation and it’s complementary annotation @AfterDomainEventPublication.

16 Oct 2017