|
36 | 36 | import java.io.File;
|
37 | 37 | import java.io.IOException;
|
38 | 38 | import java.util.Collection;
|
39 |
| -import org.apache.commons.io.IOUtils; |
40 |
| -import org.apache.commons.lang3.StringUtils; |
| 39 | +import org.cactoos.io.ResourceOf; |
41 | 40 | import org.cactoos.list.ListOf;
|
| 41 | +import org.cactoos.text.FormattedText; |
| 42 | +import org.cactoos.text.JoinedText; |
| 43 | +import org.cactoos.text.TextOf; |
42 | 44 | import org.hamcrest.Description;
|
43 | 45 | import org.hamcrest.MatcherAssert;
|
44 | 46 | import org.hamcrest.Matchers;
|
|
54 | 56 | * @todo #412:30min Split this class into smaller ones and remove PMD
|
55 | 57 | * exclude `TooManyMethods`. Good candidates for moving out of this class
|
56 | 58 | * are all that use `validateCheckstyle` method.
|
| 59 | + * @checkstyle ClassDataAbstractionCoupling (800 lines) |
| 60 | + * Can also be removed after splitting up this class into smaller ones. |
57 | 61 | */
|
58 | 62 | @SuppressWarnings(
|
59 | 63 | {
|
@@ -632,10 +636,11 @@ public void rejectsUppercaseAbbreviations() throws Exception {
|
632 | 636 | file, false
|
633 | 637 | );
|
634 | 638 | final String name = "AbbreviationAsWordInNameCheck";
|
635 |
| - final String message = StringUtils.join( |
636 |
| - "Abbreviation in name '%s' ", |
| 639 | + final String message = new JoinedText( |
| 640 | + " ", |
| 641 | + "Abbreviation in name '%s'", |
637 | 642 | "must contain no more than '2' consecutive capital letters."
|
638 |
| - ); |
| 643 | + ).asString(); |
639 | 644 | MatcherAssert.assertThat(
|
640 | 645 | results,
|
641 | 646 | Matchers.hasItems(
|
@@ -788,9 +793,11 @@ private Collection<Violation> runValidation(final String file,
|
788 | 793 | )
|
789 | 794 | .withFile(
|
790 | 795 | String.format("src/main/java/foo/%s", file),
|
791 |
| - IOUtils.toString( |
792 |
| - this.getClass().getResourceAsStream(file) |
793 |
| - ) |
| 796 | + new TextOf( |
| 797 | + new ResourceOf( |
| 798 | + new FormattedText("com/qulice/checkstyle/%s", file) |
| 799 | + ) |
| 800 | + ).asString() |
794 | 801 | );
|
795 | 802 | final Collection<Violation> results =
|
796 | 803 | new CheckstyleValidator(env).validate(
|
|
1 commit comments
0pdd commentedon Jan 24, 2019
Puzzle
966-537ebfc3
discovered inqulice-pmd/src/test/java/com/qulice/pmd/PmdAssert.java
and submitted as #1009. Please, remember that the puzzle was not necessarily added in this particular commit. Maybe it was added earlier, but we discovered it only now.