Cuppa

A testing framework for Java 8

Get Started

Be descriptive

Use strings – not identifiers – to clearly describe the behaviour you are testing. Test reports produced by Cuppa read like good documentation.

Group tests together

Create structure in your test files to reduce repetition and improve readability. Groups of tests can share setup and teardown steps.

Define tests at runtime

Cuppa makes it trivial to write parameterised tests. It's as simple as a for loop. Cuppa is also easy to extend - there's no need to write annotations.


A simple test

The syntax for writing tests in Cuppa can seem surprising at first, especially if you’re used to writing tests in JUnit or TestNG.

@Test
public class ListTest {
    {
        describe("List", () -> {
            describe("#indexOf", () -> {
                it("returns -1 when the value is not present", () -> {
                    List<Integer> list = Arrays.asList(1, 2, 3);
                    assertThat(list.indexOf(5)).isEqualTo(-1);
                });
            });
        });
    }
}

Get Started