How about OpenAPI descriptions and Swagger UI in your Java REST API?

I have this Quarkus project which uses basic JAX-RS annotations to generate your API, fairly basic and trivially simple. Yes that’s all Quarkus needs and it looks pretty much like Spring MVC or anything else. Now I’d need to create Postman test data and buid tests for all these endpoints or… or integrate it with Swagger – both to add OpenAPI style documentation AND to have a nice web GUI client to read infos and test them.

Continue reading

Eclipse error when generating JAXB classes

Sooo you’re trying to generate Java classes from your XSD schema and JAXB generation fails with no info? Oh yes it says “see the console” but in the console you see exactly one line with the xjc compiler version… no fun. And no combination of generation flags makes it better.

Continue reading

Packaging a Spring Boot application as Windows exe

I programmed once this handy tool to retrieve one-time passwords (too much insider knowledge for opensourcing it) and as soon as some teammates heard about it, they asked for a copy to spare them the zillion clicks the password generator needs. But… the tool existed only as a Maven project in my development environment 😦

Continue reading

Integration tests, part 2 (notes on Cucumber and Selenium)

(This is part 2, some learnings a few weeks into the project described here: Integration tests = secucbootCucumber + Selenium + Spring Boot)

Selenium tricks:

Use the fluent wait instead of anything else, like here waiting for the expected messages to appear. Continue reading

Integration tests = Cucumber + Selenium + Spring Boot

Let’s say you had this web application with nice unit tests covering the backend calculations, where people keep calling wrong calculations from the frontend. Microservices or not, it happens, so you’ll need proper integration testing. Let’s say the integration testing is a well documented but tedious two days job of clicking around. Understandably, everybody does their best to avoid it…

My answer was: how about we rewrite the integration test scenarios in the Gherkin almost-human-readable language, so we can use Cucumber to run them automated, simulating with Selenium the user browser actions! The supporting stack will be Java and Spring, actually Spring Boot, because you know all I have is a hammer….

Continue reading

Automated AWS provisioning with Fabric

One of these days I decided to give a try to an opensource project which happens to run only on Linux. This sounds like nothing special unless your development machine happens to be Windows 7 and you don’t want to bother with downloading and maintaining virtual images. True, Vagrant would be a good option but getting it (and VirtualBox) to work with my enterprise-grade proxy access is a real PITA. Add to that the less-than-maintained vagrant-proxyconf plugin and the zillions of tools every one with own config files for proxies (gradle, git, maven, you-name-it)… Not at least, a local virtual machine is local and we’re heading to a cloud-based society right? So, AWS to go! Continue reading