@Test
public void canValidatePomWithXpath() throws Exception {

    final MavenEnvironment env = new MavenEnvironmentMocker()
        .withAsserts(
            Collections.singletonList(
            // @checkstyle LineLength (1 line)
            "/pom:project/pom:dependencies/pom:dependency[pom:artifactId='commons-io']/pom:version[.='1.2.5']/text()"
        )
    ).mock();
    final String pom = new TextOf(
        new ResourceOf("com/qulice/maven/PomXpathValidator/pom.xml")
    ).asString();
    FileUtils.write(
        new File(
            String.format(
                "%s%spom.xml", env.basedir(), File.separator
            )
        ),
        pom,
        StandardCharsets.UTF_8
    );
    new PomXpathValidator().validate(env);
}