Skip to content

Commit a7f55e5

Browse files
committedJan 25, 2019
For #1000: Corrected mathcers
1 parent 12b3e74 commit a7f55e5

File tree

1 file changed

+17
-14
lines changed

1 file changed

+17
-14
lines changed
 

‎qulice-pmd/src/test/java/com/qulice/pmd/UseStringIsEmptyRuleTest.java

+17-14
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,11 @@
3030
package com.qulice.pmd;
3131

3232
import org.hamcrest.Matchers;
33+
import org.hamcrest.collection.IsIn;
3334
import org.hamcrest.core.IsEqual;
35+
import org.hamcrest.core.IsSame;
3436
import org.hamcrest.core.StringContains;
37+
import org.hamcrest.object.HasToString;
3538
import org.junit.Ignore;
3639
import org.junit.Test;
3740

@@ -65,8 +68,8 @@ public final class UseStringIsEmptyRuleTest {
6568
@Test
6669
public void detectsLengthLessThanOne() throws Exception {
6770
new PmdAssert(
68-
"StringLengthLessThanOne.java", Matchers.is(false),
69-
Matchers.containsString(
71+
"StringLengthLessThanOne.java", new IsEqual<>(false),
72+
new StringContains(
7073
UseStringIsEmptyRuleTest.ERR_MESSAGE
7174
)
7275
).validate();
@@ -80,8 +83,8 @@ public void detectsLengthLessThanOne() throws Exception {
8083
@Test
8184
public void detectsLengthGreaterThanZero() throws Exception {
8285
new PmdAssert(
83-
"StringLengthGreaterThanZero.java", Matchers.is(false),
84-
Matchers.containsString(
86+
"StringLengthGreaterThanZero.java", new IsEqual<>(false),
87+
new StringContains(
8588
UseStringIsEmptyRuleTest.ERR_MESSAGE
8689
)
8790
).validate();
@@ -94,8 +97,8 @@ public void detectsLengthGreaterThanZero() throws Exception {
9497
@Test
9598
public void detectsLengthEqualsZero() throws Exception {
9699
new PmdAssert(
97-
"StringLengthEqualsZero.java", Matchers.is(false),
98-
Matchers.containsString(
100+
"StringLengthEqualsZero.java", new IsEqual<>(false),
101+
new StringContains(
99102
UseStringIsEmptyRuleTest.ERR_MESSAGE
100103
)
101104
).validate();
@@ -109,8 +112,8 @@ public void detectsLengthEqualsZero() throws Exception {
109112
@Test
110113
public void detectsLengthNotEqualsZero() throws Exception {
111114
new PmdAssert(
112-
"StringLengthNotEqualsZero.java", Matchers.is(false),
113-
Matchers.containsString(
115+
"StringLengthNotEqualsZero.java", new IsEqual<>(false),
116+
new StringContains(
114117
UseStringIsEmptyRuleTest.ERR_MESSAGE
115118
)
116119
).validate();
@@ -124,8 +127,8 @@ public void detectsLengthNotEqualsZero() throws Exception {
124127
@Test
125128
public void detectsLengthGreaterOrEqualZero() throws Exception {
126129
new PmdAssert(
127-
"StringLengthGreaterOrEqualZero.java", Matchers.is(false),
128-
Matchers.containsString(
130+
"StringLengthGreaterOrEqualZero.java", new IsEqual<>(false),
131+
new StringContains(
129132
UseStringIsEmptyRuleTest.ERR_MESSAGE
130133
)
131134
).validate();
@@ -139,8 +142,8 @@ public void detectsLengthGreaterOrEqualZero() throws Exception {
139142
@Test
140143
public void detectsLengthGreaterOrEqualOne() throws Exception {
141144
new PmdAssert(
142-
"StringLengthGreaterOrEqualOne.java", Matchers.is(false),
143-
Matchers.containsString(
145+
"StringLengthGreaterOrEqualOne.java", new IsEqual<>(false),
146+
new StringContains(
144147
UseStringIsEmptyRuleTest.ERR_MESSAGE
145148
)
146149
).validate();
@@ -154,8 +157,8 @@ public void detectsLengthGreaterOrEqualOne() throws Exception {
154157
@Test
155158
public void detectsLengthLessOrEqualZero() throws Exception {
156159
new PmdAssert(
157-
"StringLengthLessOrEqualZero.java", Matchers.is(false),
158-
Matchers.containsString(
160+
"StringLengthLessOrEqualZero.java", new IsEqual<>(false),
161+
new StringContains(
159162
UseStringIsEmptyRuleTest.ERR_MESSAGE
160163
)
161164
).validate();

0 commit comments

Comments
 (0)
Please sign in to comment.