Using the console on Windows

I’m a Windows user. I don’t use OSX, I don’t use Linux, I use Windows. For real. Usually I develop Java or JavaScript applications which perfectly run under Windows, Linux, OSX or whatsoever. So developing under Windows is no problem at all. Runtime environments, IDEs, editors - Windows has it all. However, people keep wondering how I can do the most simple task:

Read More

A mocked Spring security configuration for testing

Spring security is great! It gives you the possibility to secure your app and to create a login with a few simple lines of code. However, it could also become annoying during development, when you have to log yourself in again and again. So why not create a mocked Spring authentication for development and testing?

Read More

Resizing Vagrant box disk space

Vagrant is a great tool to provision virtual machines! As I’m a passionated Windows user, Vagrant is the weapon of my choice whenever I need to use some Linux-only tools such as Docker. I spinn up a new Linux VM, already configured with the things I need and start working. However, when it comes to resizing a disk, Vagrant is not nice to you…

Read More

Create random test objects with Java reflection

Although Java is an object-oriented language, you will often separate our data and your actual business logic. You will write POJOs, entities, domain models and DTOs which you will pass to services, repositories and controllers. If you do so, you will properly need test data for those objects. Often, the data you pass will be very important as it represents the state of your application and business process. You must design it carefully to get the test results you are looking for. However, there are also some cases where the data isn’t so important - it must just be there! You need an object, filled with random data. That’s it.

Read More