@@ -15,91 +15,91 @@ public StringAssert(String string, String message) {
15
15
16
16
public StringAssert hasLength (int size ) throws AssertionError {
17
17
if (actual .length () != size ) {
18
- throwProperAssertionError ("Wrong length" );
18
+ throwAssertionErrorWithCustomMessage ("Wrong length" );
19
19
}
20
20
return self ;
21
21
}
22
22
23
23
public StringAssert equalsIgnoreCase (String expected ) {
24
24
if (!actual .equalsIgnoreCase (expected )) {
25
- throwProperAssertionError ("Not equal" );
25
+ throwAssertionErrorWithCustomMessage ("Not equal" );
26
26
}
27
27
return self ;
28
28
}
29
29
30
30
public StringAssert doesNotEqualIgnoreCase (String expected ) {
31
31
if (actual .equalsIgnoreCase (expected )) {
32
- throwProperAssertionError ("Equals" );
32
+ throwAssertionErrorWithCustomMessage ("Equals" );
33
33
}
34
34
return self ;
35
35
}
36
36
37
37
public StringAssert equals (String expected ) {
38
38
if (!actual .equals (expected )) {
39
- throwProperAssertionError ("Not equal" );
39
+ throwAssertionErrorWithCustomMessage ("Not equal" );
40
40
}
41
41
return self ;
42
42
}
43
43
44
44
public StringAssert doesNotEqual (String expected ) {
45
45
if (actual .equals (expected )) {
46
- throwProperAssertionError ("Equals" );
46
+ throwAssertionErrorWithCustomMessage ("Equals" );
47
47
}
48
48
return self ;
49
49
}
50
50
51
51
public StringAssert startsWith (String expected ) {
52
52
if (!actual .startsWith (expected )) {
53
- throwProperAssertionError ("Not start with" );
53
+ throwAssertionErrorWithCustomMessage ("Not start with" );
54
54
}
55
55
return self ;
56
56
}
57
57
58
58
public StringAssert endsWith (String expected ) {
59
59
if (!actual .endsWith (expected )) {
60
- throwProperAssertionError ("Not end with" );
60
+ throwAssertionErrorWithCustomMessage ("Not end with" );
61
61
}
62
62
return self ;
63
63
}
64
64
65
65
public StringAssert contains (String expected ) {
66
66
if (!actual .contains (expected )) {
67
- throwProperAssertionError ("Is not contained" );
67
+ throwAssertionErrorWithCustomMessage ("Is not contained" );
68
68
}
69
69
return self ;
70
70
}
71
71
72
72
public StringAssert doesNotContain (String expected ) {
73
73
if (actual .contains (expected )) {
74
- throwProperAssertionError ("Is contained" );
74
+ throwAssertionErrorWithCustomMessage ("Is contained" );
75
75
}
76
76
return self ;
77
77
}
78
78
79
79
public StringAssert isEmpty () {
80
80
if (!actual .isEmpty ()) {
81
- throwProperAssertionError ("Is not empty" );
81
+ throwAssertionErrorWithCustomMessage ("Is not empty" );
82
82
}
83
83
return self ;
84
84
}
85
85
86
86
public StringAssert isNotEmpty () {
87
87
if (actual .isEmpty ()) {
88
- throwProperAssertionError ("Is empty" );
88
+ throwAssertionErrorWithCustomMessage ("Is empty" );
89
89
}
90
90
return self ;
91
91
}
92
92
93
93
public StringAssert matches (String regex ) {
94
94
if (!actual .matches (regex )) {
95
- throwProperAssertionError ("Regex not matched" );
95
+ throwAssertionErrorWithCustomMessage ("Regex not matched" );
96
96
}
97
97
return self ;
98
98
}
99
99
100
100
public StringAssert doesNotMatch (String regex ) {
101
101
if (actual .matches (regex )) {
102
- throwProperAssertionError ("Regex matched" );
102
+ throwAssertionErrorWithCustomMessage ("Regex matched" );
103
103
}
104
104
return self ;
105
105
}
0 commit comments