Testing @ConfigurationProperties in Spring Boot 2.5.X Three years ago, I wrote an article on how to test Spring’s @ConfigurationProperties classes. Since three years are a long time, I just updated the project on GitHub. It works with Spring 2.5.X now! You can find the project right here: https://github.com/tuhrig/Testing_Configuration_Properties And here’s the old post from 2018: https://tuhrig.de/testing-configurationproperties-in-spring-boot What’s it about? The basic […]
Anti Pattern: Don’t use Optionals for data repositories Java 8 Optionals Java 8 introduced a new feature call Optionals. Optionals are an easy way to force the caller of a method to deal with a possible null return value: 123456 public Optional<String> getName() { ...} Optional<String> name = getName();System.out.println(name.orElse("I forgot my name"); If you use an Optional as the return type of your method, whoever calls the method will be reminded that it might return […]
Everytime a mock returns a mock a fairy dies As I was reading about some Mockito features last week, I stumbled over the following tweet, which really made me laugh: Everytime a mock returns a mock a fairy dies — Damian Guy (@damianguy) 18. Oktober 2009 I actually found the reference to the tweet in the Mockito source code about “deep mocking” and it’s […]
DeployMan (command line tool to deploy Docker images to AWS) DeployMan Yesterday, I published a tool called DeployMan on GitHub. DeployMan is a command line tool to deploy Docker images to AWS and was the software prototype for my master thesis. I wrote my thesis at Informatica in Stuttgart-Weilimdorf, so first of all, I want to say thank you to Thomas Kasemir for the opportunity […]
Development speed, the Docker remote API and a pattern of frustration One of the challenges Docker is facing right now, is its own development speed. Since its initial release in January 2013, there have been over 7.000 commits (in one year!) by more than 400 contributors. There are more than 1.800 forks on GitHub and Dockers brings up approximately one new release per month. Docker is […]
Java 8 for Eclipse Kepler via the Eclipse Marketplace Eclipse Foundation Announces Java 8 Support! One day after my post about Java 8 in Eclipse Kepler (4.3) and Eclipse Luna (4.4), the Eclipse Foundation announced official support for Java 8 in Eclipse Kepler. Here is there blog post straight outta Ottawa, Canada: http://eclipse.org/org/press-release/20140402_eclipse_foundation_announces_java8_support.php You can now install Java 8 support to Eclipse Kepler (4.3) […]
Java 8 in Eclipse (Kepler and Luna) Java 8 is officially available since a couple of days. It was released on March 18th this year. Yeah! But – Eclipse, the biggest and most popular Java IDE is a little bit behind the schedule (at least IMHO). There is no official Eclipse version for Java 8 right now! But there are two other […]
What static methods for interfaces tell you about the Java community Recently I was putting together some code for an OSGi plugin at work. I created an interface to add listeners to an extension point. The code looked something like this: 123 public interface AfterActionListener { public ResultObject doSomething(MyObject myObject);} The idea was simple: At some points in my application I would call all registered listeners, pass them an object and let them do […]
Java 8 in Eclipse (Juno) Note: Here is an up-to-date tutorial for the new Eclipse versions Kepler and Luna: http://tuhrig.de/java-8-in-eclipse-kepler-and-luna Since last July the new Java 7 is generally available. However, even the newer Java 8 is already available as an Early Access Preview. It can be download as part of the OpenJDK including lambda-support. To use it with Eclipse, […]