As a developer, I like to write some test code like: import static org.junit.jupiter.api.Assertions.assertNotNull; ... Foo foo = assertNotNull(bar.doSomething()).getFoo(); Deliverables An Assertions.assertNotNull() that returns its input...
It would be sweet if the assertNotNull(actual:) method returned the object that is passed into it back out as a non-null type. This would help with writing JUnit 5 tests in Kotlin big time and avoid the need to force unwrap properties like this: assertNotNull(myObject?.myProperty) val...
代码来源:apache/geodeApiVersionTest.load_version_from_file_in_classpath()@Test public void load_version_from_file_in_classpath() { Version version = ApiVersion.load(System2.INSTANCE); assertThat(version).isNotNull(); assertThat(version.major()).isGreaterThanOrEqualTo(5); } ...