Skip to content
Open

Ut1 #16

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 16 additions & 19 deletions code-coverage-jacoco/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<build.profile.id>dev</build.profile.id>
<jacoco.it.execution.data.file>${project.build.directory}/coverage-reports/jacoco-it.exec</jacoco.it.execution.data.file>
<jacoco.ut.execution.data.file>${project.build.directory}/coverage-reports/jacoco-ut.exec</jacoco.ut.execution.data.file>
<jdk.version>1.7</jdk.version>
<!-- <jdk.version>1.7</jdk.version> -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!-- Only unit tests are run by default. -->
<skip.integration.tests>true</skip.integration.tests>
Expand Down Expand Up @@ -68,7 +68,7 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.7</version>
<version>3.6.0</version>
<executions>
<!--
States that the plugin's add-test-source goal is executed at
Expand All @@ -89,28 +89,25 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>${jdk.version}</source>
<target>${jdk.version}</target>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
<!-- -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.13.0</version>
<!-- <configuration>
<source>1.7</source>
<target>1.7</target>
</configuration> -->
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
<configuration>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
<version>3.3.1</version>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.2</version>
<version>0.8.12</version>
<executions>
<!--
Prepares the property pointing to the JaCoCo runtime agent which
Expand Down Expand Up @@ -191,7 +188,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.15</version>
<version>3.3.1</version>
<configuration>
<!-- Sets the VM argument line used when unit tests are run. -->
<argLine>${surefireArgLine}</argLine>
Expand All @@ -207,7 +204,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.15</version>
<version>3.3.1</version>
<executions>
<!--
Ensures that both integration-test and verify goals of the Failsafe Maven
Expand Down
10 changes: 10 additions & 0 deletions code-coverage-jacoco/src/test/java/FizzBuzzTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@
* @author Petri Kainulainen
*/
public class FizzBuzzTest {
private FizzBuzz fizzBuzz;

@Before
public void setUp() {
fizzBuzz = new FizzBuzz();
}

@Test
public void getFizzBuzzWord_NumberIsMultipleOfThree_ShouldReturnFizz() {
assertThat(fizzBuzz.getFizzBuzzWord(3), is("Fizz"));
}

}