junit

Версия 1.2 от Alexandr Fokin на 2026/11/05 13:30

  
Примерimport org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;

@DisplayName("Test1")
public class Test1 {

   @Test
   void Case1() {
        IO.println(String.format("Hello and welcome!"));

       for (int i = 1; i <= 5; i++) {
           //TIP Press <shortcut actionId="Debug"/> to start debugging your code. We have set one <icon src="AllIcons.Debugger.Db_set_breakpoint"/> breakpoint
           // for you, but you can always add more by pressing <shortcut actionId="ToggleLineBreakpoint"/>.
           IO.println("i = " + i);
       }
   }
}
Подключение
Maven<!-- junit -->
<dependency>
   <groupId>org.junit.jupiter</groupId>
   <artifactId>junit-jupiter</artifactId>
   <version>5.14.2</version>
   <scope>test</scope>
</dependency>