0

I have one single simple test

public class SimpleCheck {
    @Test
    public void check(){
        assertTrue(1 < 0);
    }
}

I run mvn test and see following message.

[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ check-check ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.024 s
[INFO] Finished at: 2014-12-10T23:25:13+02:00
[INFO] Final Memory: 8M/245M
[INFO] ------------------------------------------------------------------------

As you noticed this test will fails, however i don't see any failures at least. I have clean pom.xml with just one junit dependency.

How to see failures?

EDIT:

I found the solution - i should simply name it with *Test prefix. My test was Check, and now it is CheckTest.

ServerSideCat
  • 1,992
  • 3
  • 18
  • 24
  • looks like you don't have assertion enabled while running tests [you need to enable them][1] [1]: http://stackoverflow.com/questions/19966620/enable-assert-in-a-maven-built-project – jmj Dec 10 '14 at 21:32

1 Answers1

1

looks like you don't have assertion enabled while running tests you need to enable them

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>2.16</version>
    <configuration>
        <enableAssertions>true</enableAssertions>
    </configuration>
  </plugin>
Community
  • 1
  • 1
jmj
  • 237,923
  • 42
  • 401
  • 438