My name is Simon Kågedal Reimer. I am a software engineer based in Uppsala, Sweden. This is my personal blog where I share my thoughts on software development, technology, and other topics that interest me.

    Posts

    Miniflux

    I test out the Miniflux feed reader and set it up on my server

    Failing at configuring CORS

    I want to test my API from Swagger UI, but failing at CORS. Finally I find a way to disable it altogether in Chrome.

    Adding an OpenAPI spec

    I'd like to have a few different clients for the Habit Tracker API, and so I'm adding an OpenAPI spec to generate them from.

    Achieving is now tracking

    We rename the "achievement" concept to the more obvious "tracking", and discuss why it is sometimes difficult to name and rename things. At least we're wearing clean underwear.

    Finalize API:s to track habits

    We discuss how we can use the IDE:s refactoring tools to move logic from the web controller to the service layer, and then reuse that from the API controller to finish the habit tracking API:s.

    HTTP clients for testing! Which one?

    As I continue the implementation and testing of the habits API, I realize I need a HTTP client with JSON support, discuss various alternatives and end up sticking with HttpClient, using a `BodyPublisher`/`BodyHandler` pair to deal with the JSON.

    Let's start looking at API:s

    I want to add some JSON REST API:s to the habit tracker, and begin with writing a first failing test. Then I figure out some authentication details, add Basic Auth and disable CSRF.

    More HTML unit

    I continue covering the functionality of the Habit Tracker with tests using the HtmlUnit framework, deal with missing support of the ECMAScript Internationalization API and get my test coverage up to 90%.

    Creating a random user

    In order to start tests from a clean slate, since we can't use the Spring framework's `@Transactional` annotation in full-server tests, I set up a way to create a random user for each test. And ask myself how to inject beans from the test package.

    Testing with HtmlUnit

    I add the HtmlUnit library and use it to test the form login in the habit tracker, and touch upon things like the deprecation of the `java.net.URL` constructors and whether I like HtmlUnit's approach with generic return types or not.

    Adding JaCoCo to Hahabit

    As I want to discuss testing of my Spring Boot habit tracker app, I add the JaCoCo code coverage tool to the project and make an `awk` script to extract a relevant number.

    Presenting Normal Score Converter

    Discussing Normal Score Converter, a tool I wrote in 2013 to convert values on common psychometric scales, and how I could bring it up to date.

    Adding summaries

    While exploring my current Jekyll theme, I discover the `excerpt` variable, and finally decide to instead use a custom `summary` variable as a blurb for each post.

    Writing a habit tracker, part 1: Setting up some tools

    First post of the Habit Tracker series, starting with my New Year's resolution to spend at least 30 minutes outside daily, transitioning into a technical walkthrough of setting up a habit tracking app backend using PostgreSQL and Java on my Digital Ocean Ubuntu server