SuperAPI AI Directory

junit

Testing & quality

View repository

Updated 10-16 10:22

About this skill

When to use this skill

Use this skill whenever the user wants to:

  • Write Java/Kotlin unit tests and extensions with JUnit 4/5
  • Use assertions, lifecycle, parameterization, and mocks (Mockito, etc.)

How to use this skill

  1. Use cases:@Test、@BeforeEach、@AfterEach;Assertions(assertEquals、assertThrows);@ParameterizedTest。
  2. Ecosystem: JUnit 5 + Mockito/AssertJ; Maven/Gradle dependencies and surefire configuration.
  3. Run: mvn test, gradle test; IDE run and coverage.

Best Practices

  • Unit tests should be independent and repeatable; avoid dependency on order and external services.
  • Use mocks to isolate dependencies; keep naming and structure clear.
  • Balance coverage and speed; always run in CI.

Keywords

junit, JUnit 5, unit testing, Java, Kotlin