mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-07 15:11:28 +07:00
(cherry picked from commit 0d22d640ea4ee77a6bdfb5b4af504332e7456b68) IJ-MR-150371 GitOrigin-RevId: 04a5fe47cf874ae78c5ad73282b55123f55e84cb
25 lines
559 B
Java
25 lines
559 B
Java
// "Assert with TestNG 'Assert.assertNotNull(s)'" "true-preview"
|
|
|
|
import org.jetbrains.annotations.Nullable;
|
|
import org.testng.Assert;
|
|
import org.testng.annotations.Test;
|
|
|
|
import static org.testng.Assert.assertTrue;
|
|
|
|
public class SomeTestNGTest {
|
|
@Nullable
|
|
String getNullableString() {
|
|
double random = Math.random();
|
|
if (random > 0.75) return null;
|
|
if (random > 0.50) return "";
|
|
else return "bruh";
|
|
}
|
|
|
|
@Test
|
|
public void test() {
|
|
String s = getNullableString();
|
|
Assert.assertNotNull(s);
|
|
assertTrue(s.isEmpty());
|
|
}
|
|
}
|