Files
openide/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/addAssertNonNullFromTestFrameworks/afterInJUnit4WithSuppressionCommment.java
Bartek Pacia 5569a2965d [java-inspections] IDEA-14669 fixed: suggest adding specific non-null assertions from test frameworks
(cherry picked from commit 0d22d640ea4ee77a6bdfb5b4af504332e7456b68)

IJ-MR-150371

GitOrigin-RevId: 04a5fe47cf874ae78c5ad73282b55123f55e84cb
2024-12-05 12:35:38 +00:00

21 lines
492 B
Java

// "Assert with JUnit 4 'Assert.assertNotNull(s)'" "true-preview"
import org.jetbrains.annotations.Nullable;
import org.junit.Assert;
import org.junit.Test;
import static org.junit.Assert.assertTrue;
public final class SomeJUnit4Test {
@Nullable
native String getNullableString();
@Test
public void test() {
String s = getNullableString();
Assert.assertNotNull(s);
//noinspection SimplifiableConditionalExpression
assertTrue(s.isEmpty() ? true : false);
}
}