Skip to content

Commit

Permalink
#877 test for forbiding Files.createFile in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
krzyk committed May 7, 2018
1 parent 9df81cd commit fe71001
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions qulice-pmd/src/test/java/com/qulice/pmd/PmdValidatorTest.java
Expand Up @@ -305,6 +305,15 @@ public void forbidsCodeInConstructor()
).validate();
}

/**
* PmdValidator forbids usage of Files.createFile.
* @throws Exception If something wrong happens inside.
*/
@Test
public void forbidsFilesCreateFile() throws Exception {
new PmdAssert("FilesCreateFileTest.java",Matchers.is(false), Matchers.containsString("Files.createFile should not be used in tests, replace them with @Rule TemporaryFolder")).validate();
}

/**
* PmdValidator accepts calls to other constructors
* or call to super class constructor in constructors.
Expand Down

0 comments on commit fe71001

Please sign in to comment.