@Test
  public void acceptRefusesFileWithNonXMLExtension() throws Exception {
    MavenPomFileScannerPlugin plugin = new MavenPomFileScannerPlugin();

    InputStream inputStream =
        new ByteArrayInputStream("<project><a></a></project>".getBytes(StandardCharsets.UTF_8));

    FileResource fileResource = Mockito.mock(FileResource.class, NOT_MOCKED_ANSWER);

    doReturn(inputStream).when(fileResource).createStream();

    String path = "/a/b/c/pom.foobar";

    boolean result = plugin.accepts(fileResource, path, DUMMY_SCOPE);

    assertThat(result, is(false));
  }
  @Test
  public void acceptAcceptsFilesWithNamePomDotXML() throws Exception {
    MavenPomFileScannerPlugin plugin = new MavenPomFileScannerPlugin();

    InputStream inputStream =
        new ByteArrayInputStream("<bla><a></a></bla>".getBytes(StandardCharsets.UTF_8));

    FileResource fileResource = Mockito.mock(FileResource.class, NOT_MOCKED_ANSWER);

    doReturn(inputStream).when(fileResource).createStream();

    String path = "/a/b/c/d.pom";

    boolean result = plugin.accepts(fileResource, path, DUMMY_SCOPE);

    assertThat(result, is(true));
  }
  @Test
  public void acceptChecksRefusesWithDifferentRootTagfExtensionIsXMLAndNonStandardName()
      throws Exception {
    MavenPomFileScannerPlugin plugin = new MavenPomFileScannerPlugin();

    InputStream inputStream =
        new ByteArrayInputStream("<root><a></a></root>".getBytes(StandardCharsets.UTF_8));

    FileResource fileResource = Mockito.mock(FileResource.class, NOT_MOCKED_ANSWER);

    doReturn(inputStream).when(fileResource).createStream();

    String path = "/a/b/c/d.xml";

    boolean result = plugin.accepts(fileResource, path, DUMMY_SCOPE);

    assertThat(result, is(false));
  }