I was reading an article about property-based testing the other day. This article started with the problem that it could be difficult to test all the cases of a function and that this was cumbersome and error prone. This triggered me to think about why such a function would be difficult to test. The switch statement During the years I … Lees verder Cleaning up switch cases with clean code for easy testing
In this first installment of Testing with state using GraphWalker, we’ll look at integration testing the persistence layer of a Spring application. So, our tests will target the database and the data repositories. Statefulness The database itself is inherently stateful. As a result, if we connect a data repository to an actual database, it will also show stateful behavior. For … Lees verder Testing with state using GraphWalker | Part 1 – Persistence
This post will demonstrate generating test data using junit-quickcheck. It will focus on practical examples, rather than the theory behind property based testing.
This will be a series of articles revolving around unit testing where I will work through examples and exploring various aspects of the craft. This is the first installment. This post is a crosspost from my personal blog. The code associated with this article can be found on GitHub. Future and past installments can be found in The Librarian Archive. … Lees verder The Librarian: Introduction to Test-Driven Development
In a previous post I introduced thinking about (visual) components and used a Task Browser as an example of an user interface “component” . I explained that using View Model(s) e.g. plain-old Groovy objects (POGOs) holding the related data e.g. a class TaskBrowser Tag Libraries (LayoutTagLib) and tags (def taskBrowser) to render the associated HTML (views/layouts/components/_taskBrowser.gsp) to the page allows for … Lees verder So If You’re Using Tag Libraries for Your View Models You Have To Test Them, Right?
In a previous blog post we discussed a bit on how you can integrate Keycloak with JAX-RS. In this blog post we’ll show an example on how to build an integration test to test if your REST endpoint is secured. In this setup, we are using Keycloak 1.4.0 for our identity management, and we deploy our application in Wildfly 9. (Older versions … Lees verder Testing Keycloak integration with Arquillian
Sometimes you may need to mock Grails (application) configuration in an unit or integration test. E.g. you want to test code which normally would access the property jmxEnabled from the following configuration block: In Grails 2 in Config.groovy
jmxEnabled = true
or Grails 3 in application.yml
Here’s are the most simple options for a Grails 2.4.x or Grails 3.0.x Spock unit- or integration … Lees verder How to mock configuration in a Grails unit- or integration test?
In the previous blog post we learned how we could scale an application horizontally. If you run your application on multiple gears, life becomes a bit more complicated. If you are investigating a production problem, the first thing in general to look at is the applications log file. Since there is now more than one instance, there are multiple log … Lees verder Managing multiple gears with Open Shift
For a project I wanted to add strict HTML 5 syntax checking. It is not something that is easy to do in the build since in general it requires the web application to be deployed. It is a simple Spring MVC project with Velocity templates so it is easy to make HTML mistakes, and verifying partial templates doesn’t really help. … Lees verder Extending unicorn validator for Jenkins
About CDN’s Content delivery networks (CDN) are useful for a number of things. They can lower latency for your website, increase your scalability by handling most of your static content and often offer some DDoS protection as well. If you have a website that is a bit more than a simple static html page, there are some things you need … Lees verder Using nginx to develop your website for use with CDN (1)