use of org.apache.qpid.server.security.access.plugins.AclRule in project qpid-broker-j by apache.
the class MessagingACLTest method configureACL.
private void configureACL(String... rules) throws Exception {
EventLoggerProvider eventLoggerProvider = mock(EventLoggerProvider.class);
EventLogger eventLogger = mock(EventLogger.class);
when(eventLoggerProvider.getEventLogger()).thenReturn(eventLogger);
List<AclRule> aclRules = new ArrayList<>();
try (StringReader stringReader = new StringReader(Arrays.stream(rules).collect(Collectors.joining(LINE_SEPARATOR)))) {
RuleSet ruleSet = AclFileParser.parse(stringReader, eventLoggerProvider);
for (final Rule rule : ruleSet) {
aclRules.add(rule.asAclRule());
}
}
configureACL(aclRules.toArray(new AclRule[aclRules.size()]));
}
Aggregations