Skip to content

Mockito#mockStatic(Class<?>) skips DoNotMockEnforcer #3219

Description

@andrebrait

This is pretty straightforward and being followed up by a PR, but essentially, any calls to mockStatic skip the DoNotMockEnforcer entirely.

@DoNotMock
class TypeAnnotatedWithDoNotMock {}

// This does not throw an exception. Checking the stack, I see that DoNotMockEnforcer is never called.
Mockito.mockStatic(TypeAnnotatedWithDoNotMock.class);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions