Skip to content

Rule Priority can not be set #1633

@mmoossen

Description

@mmoossen

Hi,

I realized that on violations a priority is logged:

java.lang.AssertionError: Architecture Violation [Priority: MEDIUM] - Rule 'xxx.' was violated (x times)

MEDIUM is the default, but I do have rules i would like to mark with a different priority.

I was expecting it to be as easy as:

classes().should(...).as("...").priority(Priority.HIGH);

but there is no way to change the priority in ArchRule.
The only way i found was to use ArchRule.Factory.create(...) which far to difficult.

The docs do not mention the priority at all.

any help greatly appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    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