O Meu pom.xml está assim:
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<properties>
<maven.compiler.source>1.6</maven.compiler.source>
<maven.compiler.target>1.6</maven.compiler.target>
</properties>
<modelVersion>4.0.0</modelVersion>
<groupId>br.com.alura.maven</groupId>
<artifactId>produtos</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>produtos</name>
<url>http://alura.com.br</url>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/com.thoughtworks.xstream/xstream -->
<dependency>
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
<version>1.4.8</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.hibernate/hibernate-core -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>5.3.7.Final</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>3.11.0</version>
<executions>
<execution>
<phase>verify</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.7.5.201505241946</version>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Minha classe de teste está assim:
package br.com.alura.maven;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
public class ProdutoTeste {
@Test
public void verificaPrecoComImposto() {
Produto bala = new Produto("juquinha", 0.10);
assertEquals(0.11, bala.getPrecoComImposto(), 0.0001);
}
}
Minha classe produto está assim:
package br.com.alura.maven;
public class Produto{
private final String nome;
private final double preco;
public Produto(String nome, double preco) {
super();
this.nome = nome;
this.preco = preco;
}
public String getNome() {
return nome;
}
public double getPreco() {
return preco;
}
public double getPrecoComImposto() {
return preco * 1.10;
}
}
O que pode ser?