Entries

HOW-TO: Test dependencies in a Maven project (JUnit, Mocito, Hamcrest, AssertJ)

JUnit itself is not enough for most of today's Java projects. You also need a mocking library, maybe something else. In this mini HOW-TO I present the test dependencies you can start with in a new Java project.

JUnit ExpectedException rule: beyond basics

There are different ways of handling exceptions in JUnit tests. As I wrote in one of my previous posts , my preferable way is using org.junit.rules.ExpectedException rule. Basically, rules are used as an alternative (or an addition) to methods annotated with org.junit.Before , org.junit.After , org.junit.BeforeClass , or org.junit.AfterClass , but they are more powerful, and more easily shared between projects and classes. In this post I will show more advanced usage of org.junit.rules.ExpectedException rule.

Teacher's notes about reporting issues: theory and practice

In 2014, for the second time, I am a lecturer at Postgraduate Studies on Software Testing. I mainly run lectures, actually workshops, about tools and automation. The object of one of the workshops was to present and practice reporting issues in Jira . During the first day of workshop, students were testing a simple web application ( https://github.com/kolorobot/spring-mvc-icm-demo ) based on the test cases they created. As a result of testing they were asked to report their findings.

Colored logs in a console (ANSI styling)

We had recently a big debate about logging in applications at my company. Inspired by my colleague, I decided to check how coloring will work on my Windows 8 64-bit machine . The idea is to have the logs colored in the console. Maybe a small detail, but while going through huge amounts of logs - can be handy. So I gave it a try.

Configure favicon.ico in Spring MVC based application

Favicon is an icon (favicon.ico) associated with your website. Not every website is using favicon though. But most browsers do not care about it and they make request for it anyways. When favicon is not in place the server will return unnecessary 404 Not Found error.