JDriven Blog

Write your own mock

Posted on by  
Ronald Koster

We all know mocking libraries like Mockito or Mockk to mock classes in our unit tests. They can be convenient to mock I/O with external systems by replacing the boundary classes (aka. DAO = Data Access Objects) with mock objects. That way we do not require a full-blown simulator of that external system. However, mocking using these libraries also has some drawbacks. One way to avoid these drawbacks is to write your own mocks.

Continue reading →

Vrijheid en Uniformiteit in Softwareontwikkeling; Hoe draagt een Enablement Team hier aan bij

Posted on by  
Willem Cheizoo

Binnen softwareontwikkeling worden teams vaak geconfronteerd met een spanningsveld tussen keuzevrijheid en standaardisatie. Aan de ene kant zorgt keuzevrijheid ervoor dat teams tools en technologieën kunnen kiezen die het beste aansluiten bij hun specifieke behoeften en hun persoonlijke voorkeuren. Aan de andere kant kan standaardisatie juist helpen om uniformiteit en stabiliteit binnen een organisatie te waarborgen. De sleutel tot het vinden van een gezonde balans ligt in het ondersteunen van beide doelen, mogelijk door het introduceren van een Enablement team. Ik leg graag uit waarom.

Continue reading →

Spring Boot Sweets: Using Duration Type With Configuration Properties

Posted on by  
Hubert Klein Ikkink

With @ConfigurationProperties in Spring Boot we can bind configuration properties to Java classes. The class annotated with @ConfigurationProperties can be injected into other classes and used in our code. We can use the type Duration to configure properties that express a duration. When we set the value of the property we can use:

  • a long value with the unit to express milliseconds,

  • a value following the ISO-8601 duration format,

  • a special format supported by Spring Boot with the value and unit.

Continue reading →

Java Joy: Using JShell With Standard Input

Posted on by  
Hubert Klein Ikkink

The Java Development Kit (JDK) includes a tool called jshell that can be used to interactively test Java code. Normally we run jshell and type Java code to be executed from an interactive shell. But we can also use jshell as a tool on the command line to accept standard input containing Java code to be executed. The output of the code can be used as input for another tool on the command line. We run jshell - to run jshell and accept standard input. The simplest way to pass Java code to jshell is to use echo to print the Java code to standard output and pipe it to jshell.

Continue reading →

InnerSource: Open Source mindset through Tech Culture

Posted on by  
Erik Pronk

In our day to day work we are always striving to innovate and deliver high-quality software. One technique that could help you be more successful in achieving these goals is inner source. Inner source refers to applying open source principles within an organization. It is about adopting the collaborative, transparent, and decentralized approach commonly seen in open source projects and applying it to the organization’s internal software development.

Continue reading →

Spring Boot Sweets: Using Configuration Properties With DataSize

Posted on by  
Hubert Klein Ikkink

With @ConfigurationProperties in Spring Boot we can bind configuration properties to Java classes. The class annotated with @ConfigurationProperties can be injected into other classes and used in our code. We can use the type DataSize to configure properties that express a size in bytes. When we set the value of the property we can use a long value. The size is then in bytes as that is the default unit. We can also add a unit to the value. Valid units are B for bytes, KB for kilobytes, MB for megabytes, GB for gigabytes and TB for terabytes.

We can also use the @DataSizeUnit annotation to specify the unit of the property in our class annotated with @ConfigurationProperties. In that case a the value without a unit assigned to the property is already in the specified unit.

Continue reading →

Taming Kubernetes with K9S, a devs best friend

Posted on by  
Thomas de Groot

Today is the 4th of October which is World Animal Welfare Day.
As a tribute, I would like to dedicate this blog to the man’s developer’s best friend: K9S.

All jokes aside, I would like to address the struggle I see with DevOps teams. It is expected of every team member to possess the skills to manage your code but also the operations side like the CI/CD pipeline, and infrastructure like Kubernetes and Cloud providers. Reality has learned that not every developer has extended knowledge of all those things like for example Kubernetes. In this blog, I want to advocate for awareness of the difference in expertise and how I think you could help your team to learn and improve. For example, the CLI and Kubernetes aren’t everyone’s besties, but with the CLI UI tool K9S, you can make Kubernetes a little more accessible for everyone.

Continue reading →

Green Code: Engineering Sustainable Software

Posted on by  
Erik Pronk

As software engineers, we are constantly looking for ways to build faster, more scalable, and more efficient systems. But we often overlook one critical aspect: sustainability. Just as in sports, where long-term success comes from balancing peak performance with endurance, sustainable software engineering is about creating systems that not only perform well today but also remain viable and efficient in the future.

Continue reading →

shadow-left