Skip to content

Jacoco breaks when throwing exceptions using .class #208

@martinmladenov

Description

@martinmladenov

A line such as this causes Jacoco to break and stop counting lines as being covered.

when(tRepository.getTripById(1L)).thenThrow(ElementNotFoundException.class);

Replacing this with an object instance fixes the problem and Jacoco then works as expected.

when(tRepository.getTripById(1L)).thenThrow(new ElementNotFoundException());

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions