1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.testtools.common;
17
18 import org.junit.Assert;
19 import org.junit.Test;
20
21
22
23
24 public class JiraAwareFailureUtilsTest implements JiraAwareFailable {
25
26 String message;
27
28 @Test
29 public void testJiraAwareFailureRegex() {
30 JiraAwareFailureUtils.regexJiraMatches.put("TEST.*UNIQUE.*TEST", "KULRICE-TEST");
31 JiraAwareFailureUtils.failOnMatchedJira("TEST UNIQUE data for TEST", this);
32 Assert.assertTrue(message.contains("KULRICE-TEST"));
33 }
34
35 @Test
36 public void testJiraAwareFailureContains() {
37 JiraAwareFailureUtils.jiraMatches.put("TEST\u0020UNIQUE\u0020TEST", "KULRICE-TEST2");
38 JiraAwareFailureUtils.failOnMatchedJira("TEST UNIQUE TEST", this);
39 Assert.assertTrue(message.contains("KULRICE-TEST2"));
40 }
41
42 @Override
43 public void fail(String message) {
44 this.message = message;
45 }
46
47 @Override
48 public void jiraAwareFail(String message) {
49 this.message = message;
50 }
51
52 @Override
53 public void jiraAwareFail(String contents, String message) {
54 this.message = message;
55 }
56
57 @Override
58 public void jiraAwareFail(String contents, String message, Throwable throwable) {
59 this.message = message;
60 }
61 }