<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
<scope>test</scope>
</dependency>
groovy
testImplementation 'junit:junit:4.13.2'
import org.junit.Test;
import static org.junit.Assert.assertEquals;
public class MyLibraryTest {
@Test
public void testAdd() {
MyLibrary library = new MyLibrary();
int result = library.add(2, 3);
assertEquals(5, result);
}
}
mvn test
gradlew test