28 lines
648 B
Java
Raw Normal View History

2016-04-15 23:47:32 +03:00
package com.baeldung;
import org.junit.gen5.api.Test;
import static org.junit.gen5.api.Assertions.assertAll;
import static org.junit.gen5.api.Assertions.assertEquals;
import static org.junit.gen5.api.Assertions.assertTrue;
class FirstTest {
@Test
void lambdaExpressions() {
String string = "";
assertTrue(() -> string.isEmpty(), "String should be empty");
}
@Test
void groupAssertions() {
int[] numbers = {0,1,2,3,4};
assertAll("numbers", () -> {
assertEquals(numbers[0], 1);
assertEquals(numbers[3], 3);
assertEquals(numbers[4], 1);
});
}
}