Technical details

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

  • Purpose: Adding meta information for automated detection of test methods.


Figure 382. 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 383. 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: /home/goik/.m2/repository/junit/junit/4.12/junit-4.12.jar

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


Figure 384. 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
...