Java Collections.assertThat Examples

Java Collections.assertThat - 4 examples found. These are the top rated real world Java examples of java.util.Collections.assertThat extracted from open source projects. You can rate examples to help us improve the quality of examples.
 @Test
 public void canLookInMultipleClassDirectories() throws Exception {
   File newFile = createFileForClass(TestFakeProduct.class);
   File thisFile = InfinitestTestUtils.getFileForClass(getClass());
   Set<File> changedFiles = detector.findChangedFiles();
   assertThat(changedFiles, hasItem(newFile));
   assertThat(changedFiles, hasItem(thisFile));
 }
  @Test
  public void shouldFindRemovedFiles() throws Exception {
    File newFile = createFileForClass(TestFakeProduct.class);
    assertThat(detector.findChangedFiles(), hasItem(newFile));

    FileUtils.forceDelete(newFile);

    assertTrue(detector.filesWereRemoved());
    assertThat(detector.findChangedFiles(), not(hasItem(newFile)));
  }
  @Test
  public void turnOffWExtension() {
    parser.recognizeAlternativeLongOptions(false);

    try {
      parser.parse("-W", "silent");
      fail();
    } catch (UnrecognizedOptionException expected) {
      assertThat(expected.options(), hasSameContentsAs(singleton("W")));
    }
  }
 @Test
 public void shouldFindChangedFiles() throws IOException {
   Set<File> files = detector.findChangedFiles();
   assertTrue("Should have found changed files on first run", files.size() > 0);
   assertThat(
       "TestFakeProduct should be in changed list",
       files,
       hasItem(getFileForClass(TestFakeProduct.class)));
   assertTrue(
       "FakeProduct should be in changed list",
       files.contains(getFileForClass(FakeProduct.class)));
   assertTrue("Should have no changed files now", detector.findChangedFiles().isEmpty());
 }