Skip to content

Recipe to add missing @Test annotations #772

@greg-at-moderne

Description

@greg-at-moderne

What problem are you trying to solve?

Find and fix test cases which are forgotten and thus are not executed.

Some heuristics is probably needed to determine if given method is indeed a test case and not some helper method.

This is relevant to JUnit 4+ which uses annotations to determine if something is a test case.
(Possibly other test frameworks use the same approach and the recipe could cover them too).

Describe the situation before applying the recipe

    void testAddition() {
        int result = calculator.add(2, 3);
        Assertions.assertEquals(5, result);
    }

Describe the situation after applying the recipe

    @Test
    void testAddition() {
        int result = calculator.add(2, 3);
        Assertions.assertEquals(5, result);
    }

OSS repro

Metadata

Metadata

Assignees

No one assigned

    Labels

    recipeRecipe request

    Type

    No type

    Projects

    Status

    Recipes Wanted

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions