Build Status



Capturing Human Intelligence - ApprovalTests is an open source assertion/verification library to aid unit testing.

It is compatible with JUnit 3, 4 & 5 and TestNG.

The jars can be used from JDK 1.7 on up until JDK 14.

What can it be used for?

Approval Tests can be used for verifying objects that require more than a simple assert. They also come prepackaged with utilities for some common java scenarios including


Getting started

The best way to get started is download and open the Starter Project.
It is a maven project and can be imported into any editor.

How to get it

It's on Maven Central, search for 'approvaltests'. If you're using Maven, add this to your pom file:


or download the jars from maven central repository

Video Tutorials

You can watch a bunch of short videos on getting started and using ApprovalTests in Java at youtube.

Note: There are a lot of videos about ApprovalTests in .Net They are equally useful for understanding the concepts despite being in a different programming language.


If you prefer auditory learning, you might enjoy the following podcast (Note: Some of these talk about the .net side)


ApprovalTests eats it own dogfood, so the best examples are in the source code itself.

None the less, Here's a quick look

public class SampleArrayTest
  public void testList()
    String[] names = {"Llewellyn", "James", "Dan", "Jason", "Katrina"};
    Approvals.verifyAll("", names);

snippet source | anchor

Will Produce a File SampleTest.TestList.received.txt

[0] = Dan
[1] = James
[2] = Jason
[3] = Katrina
[4] = Llewellyn

snippet source | anchor

Simply rename this to SampleTest.testList.approved.txt and the test will now pass.

Approved File Artifacts

The *.approved.* files must be checked into source your source control. This can be an issue with git as it will change the line endings. The suggested fix is to add *.approved.* binary to your .gitattributes

More Info


Apache 2.0 License


twitter: @LlewellynFalco or #ApprovalTests

Developer notes

The suggested way to contribute to ApprovalTests is to pair with Llewellyn
However, if you are set on forking please read these notes