File tree 3 files changed +11
-10
lines changed
src/test/java/com/qulice/pmd
3 files changed +11
-10
lines changed Original file line number Diff line number Diff line change 134
134
<artifactId >commons-lang3</artifactId >
135
135
<version >3.7</version >
136
136
</dependency >
137
+ <dependency >
138
+ <groupId >org.cactoos</groupId >
139
+ <artifactId >cactoos</artifactId >
140
+ <version >0.41</version >
141
+ </dependency >
137
142
<dependency >
138
143
<groupId >org.junit.jupiter</groupId >
139
144
<artifactId >junit-jupiter-api</artifactId >
Original file line number Diff line number Diff line change 83
83
<scope >runtime</scope >
84
84
</dependency >
85
85
<dependency >
86
- <groupId >commons-io </groupId >
87
- <artifactId >commons-io </artifactId >
86
+ <groupId >org.cactoos </groupId >
87
+ <artifactId >cactoos </artifactId >
88
88
</dependency >
89
89
<dependency >
90
90
<groupId >org.junit.jupiter</groupId >
Original file line number Diff line number Diff line change 32
32
import com .qulice .spi .Environment ;
33
33
import com .qulice .spi .Violation ;
34
34
import java .io .File ;
35
- import java .nio .charset .StandardCharsets ;
36
35
import java .util .Collection ;
37
36
import java .util .Collections ;
38
- import org .apache . commons . io . IOUtils ;
37
+ import org .cactoos . text . TextOf ;
39
38
import org .hamcrest .Matcher ;
40
39
import org .hamcrest .MatcherAssert ;
41
40
@@ -75,18 +74,15 @@ final class PmdAssert {
75
74
/**
76
75
* Validated given file against PMD.
77
76
* @throws Exception In case of error.
78
- * @todo #966:5min Add Cactoos dependency to qulice-pmd and replace IOUtils
79
- * usage with Cactoos alternatives `TextOf` and `ResourceOf`
80
77
*/
81
78
public void validate () throws Exception {
82
79
final Environment .Mock mock = new Environment .Mock ();
83
80
final String name = String .format ("src/main/java/foo/%s" , this .file );
84
81
final Environment env = mock .withFile (
85
82
name ,
86
- IOUtils .toString (
87
- this .getClass ().getResourceAsStream (this .file ),
88
- StandardCharsets .UTF_8
89
- )
83
+ new TextOf (
84
+ this .getClass ().getResourceAsStream (this .file )
85
+ ).asString ()
90
86
);
91
87
final Collection <Violation > violations = new PmdValidator (env ).validate (
92
88
Collections .singletonList (new File (env .basedir (), name ))
You can’t perform that action at this time.
0 commit comments