Geb
Learn Geb + Spock : The best of breed solution for all your UI automation needs
If you are starting a new UI automation project for your web application, and have developer-grade test engineers on your team, look no further than Geb + Spock!
Amen to that.
The crew at @automationskool have teased a Geb articles series which I hope gets published soon.
I love Geb and I hope we can spread the word about it as much as possible. I will be talking at Commit Conf 2018 about Geb the 24th of November. If you in Madrid, don't hesitate to ping me.
Micronaut
Gradle
Writing Custom Plugins
I like Asciidoc and use it every day. But I often need to write technical documentation in Markdown or HTML. I must confess that I enjoy writing Markdown more than Asciidoc. IAWriter is such an awesome editor. The feature that I miss the most is the ability to import real code snippets in markdown files. Because of that, I am writing a Gradle plugin to use the asciidoc include directive in a markdown/html file. The plugin looks for those directives and replaces them.
The linked Gradle guide was a good starting point for my journey in writing a standalone Gradle plugin. I will keep you posted on my progress.
Griffon
Griffon Becomes 10! š
At that time Grails was making a big splash in the Groovy community, thus we decided to follow their lead and create a āGrails for desktop applicationsā, and so Griffon became a reality when Danno posted the announcement for Griffon 0.0 back in September 10th 2008.
Keeps going strong:
Weāre now working on the next major version, 3.0.0. Some of the things weāre looking at the moment that will form part of the next major version are
- Java 8 bytecode as a minimum.
- Jigsaw compatibility, i.e, ability to run applications in the module classpath.
- JSR377 integration. Griffon is the Reference Implementation for JSR377.
- Merge Basilisk with Griffon, allowing a single framework to be used to write desktop/mobile applications.
- JUnit5 integration.
Libraries
Project Lombok
This helps to write nice POJOs if you cannot use Groovy.
Project Lombok is a java library that automatically plugs into your editor and build tools, spicing up your java. Never write another getter or equals method again. Early access to future java features such as val, and much more.
Misc
Non-null is the Default
@jessewilson explains in this articles, Rolling out @Nullable and Non-null is the Default, why they decided to use @Nullable
and @NotNull
through their codebase to achieve better Null Pointer exception protection and also to play better with languages such as Kotlin.
If you are overwhelmed by the thought of going through every file and adding @NotNull
or @Nullable
, don't be.
Unfortunately,
@Nonnull
everywhere is boilerplate everywhere. This extra code distracts from the real problems weāre solving. Thankfully, thereās a solution: JSR 305ās@ParametersAreNonnullByDefault
indicates that everything in an entire package is non-null unless otherwise specified
@Nullable and @NotNull
In case you are asking yourself why should you bother with @Nullable
:
@Nullable and @NotNull annotations let you check nullability of a variable, parameter, or return value. They help you control contracts throughout method hierarchies, and if IntelliJ IDEA spots that the contract is being violated, it will report the detected problem, and will point to the code where NullPointerException may occur.
Making JSR 305 Work On Java 9
Not everything is good news, a cautionary tale:
Do you use JSR 305 annotations like
@Nonnull
or@Nullable
together with annotations from the javax.annotation package, for example@Generated
or@PostConstruct
? If so, then migrating to Java 9 wonāt be straight-forward due to split packages.
Comment
This week, I went deeper into the jungle of NPE avoidance. Please, join me to make our code safer.
Sergio del Amo