public boolean apply(ActiveRule input) {
return input.getRule().equals(rule);
}
- })){
- throw new IllegalStateException(String.format("The rule '%s:%s' is already activated on the profile '%s' (language '%s')",
- rule.getRepositoryKey(), rule.getKey(), getName(), getLanguage()));
+ })) {
+ throw new IllegalStateException(String.format(
+ "The definition of the profile '%s' (language '%s') contains multiple occurrences of the '%s:%s' rule. The plugin which declares this profile should fix this.",
+ getName(), getLanguage(), rule.getRepositoryKey(), rule.getKey()));
}
ActiveRule activeRule = new ActiveRule();
activeRule.setRule(rule);
profile.activateRule(rule, null);
fail();
} catch (Exception e) {
- assertThat(e).isInstanceOf(IllegalStateException.class).hasMessage("The rule 'repo:key1' is already activated on the profile 'Default' (language 'java')");
+ assertThat(e).isInstanceOf(IllegalStateException.class)
+ .hasMessage("The definition of the profile 'Default' (language 'java') contains multiple occurrences of the 'repo:key1' rule. The plugin which declares this profile should fix this.");
}
}
}