Technical details

Figure 366. The @Test annotation Slide presentation Create comment in forum
public
@interface Test {
...
}
  • @interface defining an annotation.

  • Purpose: Allows for automatic detection of test methods.


Figure 367. The Assert class Slide presentation Create comment in forum
public class Assert {

  public static void assertTrue(
    String message, boolean condition) { ...}

  public static void assertEquals(
    long expected, long actual) { ...}
...
}

Figure 368. Importing dependencies Slide presentation Create comment in forum
<project ...>
...
  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.12</version>

      <scope>test</scope>
    </dependency>
    ...
  </dependencies>
  ...
</project>

Local file path:

/home/goik/.m2/repository/junit/junit/4.12/junit-4.12.jar

Remote address:

https://mvnrepository.com/artifact/junit/junit/4.12


Figure 369. Dependency archive content Slide presentation Create comment in forum
> jar -tf junit-4.12.jar
META-INF/
META-INF/MANIFEST.MF
org/
org/junit/
...
org/junit/Assert.class
...