@Test public void disallowed_list_only_nok() { AuthorizationRule rule = new AuthorizationRule(); CommitInformation commitInformation = new CommitInformation(); commitInformation.setAuthor("test"); RuleExecutionResult result = rule.apply(context, new AuthorizationRuleOptions("", "stephan,ursula"), commitInformation); assertNotNull(result); assertEquals(RuleExecutionResultType.FAIL, result.getType()); assertEquals("[AUTHORIZATION-001] Author \"test\" is not authorized.", result.getMessage()); }
@Test public void combined_list_ok() { AuthorizationRule rule = new AuthorizationRule(); CommitInformation commitInformation = new CommitInformation(); commitInformation.setAuthor("test"); RuleExecutionResult result = rule.apply( context, new AuthorizationRuleOptions("test", "stephan,ursula"), commitInformation); assertNotNull(result); assertEquals(RuleExecutionResultType.OK, result.getType()); assertNull(result.getMessage()); }