Home » Tag Archives: Testing (page 2)

Tag Archives: Testing

How to Replace Rules in JUnit 5

junit-logo

The recently published JUnit 5 (aka JUnit Lambda) alpha release caught my interest and while skimming through the documentation I noticed that rules are gone – as well as runners and class rules. According to the documentation, these partially competing concepts have been replaced by a single consistent extension model. Over the years, Frank and I wrote several rules to ...

Read More »

Clean architecture of Selenium tests

selenium-logo

In this blog post, I would like to introduce a clean architecture for Selenium tests with best design patterns: page object, page element (often called HTML wrapper) and self-developed, very small but smart framework. The architecture is not restricted to Java which is used in the examples and can be applied to Selenium tests in any other language as well. ...

Read More »

Verifying DateTime and Date with Hamcrest

hamcrest-logo

Since I started diving into automated testing and practicing TDD, verification of date values was pain. Luckily there is nice library for legacy Date and new Java 8 DateTime APIs, which cures this pain. If you belong to healthier part of Java development community and practicing unit testing on daily basis, you probably are aware of Hamcrest Java library. It ...

Read More »

JUnit 5 – Basics

junit-logo

Last week we’ve set up JUnit 5 to be able to write tests. So let’s do it! Overview This post is part of a series about JUnit 5: Setup Basics Architecture Conditions Injection … Most of what you will read here and more can be found in the emerging JUnit 5 user guide. Note that it is based on an ...

Read More »

JUnit 5 – A First Look at the Next Generation of JUnit

junit-logo

In the beginning of February, the JUnit 5 (aka JUnit Lambda) team has published an alpha release. Since JUnit 4 is among the most used items in my toolbox I thought it might be worth to have a look at the next major release. I took the latest build for a spin and noted down the changes that I found noteworthy here. ...

Read More »

JUnit 5 – Setup

junit-logo

In November 2015 the JUnit Lambda team presented their prototype. Since then the project rebranded itself as JUnit 5 and released an alpha version in February 2016. We’ll explore it in a series of short posts: Setup Basics Architecture Conditions Injection … This one discusses the JUnit 5 setup so you can write code against the new API and run ...

Read More »

Isolating integration tests and mocking dependencies with Spring Boot

spring-interview-questions-answers

Integration tests can be slow and unreliable because they depend on too many components in the system. Up to a certain point, this is unavoidable: integration tests are here to validate how each part of your system plays with other internal or external components. We can, however, improve some integration tests by only spinning up the required dependencies, instead of ...

Read More »

Use JUnit’s expected exceptions sparingly

junit-logo

Sometimes, when we get pull requests for jOOQ or our other libraries, people change the code in our unit tests to be more “idiomatic JUnit”. In particular, this means that they tend to change this (admittedly not so pretty code): @Test public void testValueOfIntInvalid() { try { ubyte((UByte.MIN_VALUE) - 1); fail(); } catch (NumberFormatException e) {} try { ubyte((UByte.MAX_VALUE) + ...

Read More »

Testing: Appetite Comes With Eating

software-development-2-logo

I’ve written a lot about testing. Some tips on integration tests, some how-tos, some general opinions about tests. But I haven’t told my “personal story” about testing. Why are tests needed should be obvious by now. It’s not all about finding bugs (because then you can use an excuse like “QAs will find them anyway”), it’s about having a codebase ...

Read More »

Container Object pattern. A new pattern for your tests.

java-interview-questions-answers

If you search for a description of what Page Object is, you’ll find that The Page Object Pattern gives us a common sense way to model content in a reusable and maintainable way. And also points that: Within your web app’s UI there are areas that your tests interact with. A Page Object simply models these as objects within the ...

Read More »

Want to take your Java skills to the next level?

Grab our programming books for FREE!

Here are some of the eBooks you will get:

  • Advanced Java Guide
  • Java Design Patterns
  • JMeter Tutorial
  • Java 8 Features Tutorial
  • JUnit Tutorial
  • JSF Programming Cookbook
  • Java Concurrency Essentials