October 2017
Intermediate to advanced
350 pages
7h 29m
English
The Jupiter annotation @Disabled (located in the package org.junit.jupiter.api) can be used to skip tests. It can be used at class level or method level. The following example uses the annotation @Disabled at method level and therefore it forces to skip the test:
package io.github.bonigarcia;import org.junit.jupiter.api.Disabled;import org.junit.jupiter.api.Test;class DisabledTest { @Disabled @Test void skippedTest() { }}As shown in the following screenshot, when we execute this example, the test will be counted as skipped:

In this other example, the annotation @Disabled is placed at the ...
Read now
Unlock full access